]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: replace MAX() with std::max()
authorYan, Zheng <zyan@redhat.com>
Sat, 17 Mar 2018 09:29:30 +0000 (17:29 +0800)
committerYan, Zheng <zyan@redhat.com>
Sun, 18 Mar 2018 14:24:48 +0000 (22:24 +0800)
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
src/mds/SnapClient.cc
src/mds/SnapClient.h
src/mds/SnapRealm.cc

index df667df3b807ae58908bf57c76e996e13b8f087f..82b1111cb225f2e36b0ee80bc9ce1b8e5a9005c6 100644 (file)
@@ -31,9 +31,9 @@ void SnapClient::resend_queries()
   if (!waiting_for_version.empty() || (!synced && sync_reqid > 0)) {
     version_t want;
     if (!waiting_for_version.empty())
-      want = MAX(cached_version, waiting_for_version.rbegin()->first);
+      want = std::max<version_t>(cached_version, waiting_for_version.rbegin()->first);
     else
-      want = MAX(cached_version, 1);
+      want = std::max<version_t>(cached_version, 1);
     refresh(want, NULL);
     if (!synced)
       sync_reqid = last_reqid;
@@ -164,7 +164,7 @@ void SnapClient::sync(MDSInternalContextBase *onfinish)
 {
   dout(10) << __func__ << dendl;
 
-  refresh(MAX(cached_version, 1), onfinish);
+  refresh(std::max<version_t>(cached_version, 1), onfinish);
   synced = false;
   if (server_ready)
     sync_reqid = last_reqid;
index 8c30b2cc338ec66e3b6940a217608d91fa010115..b9d8d71cbb8136f7316faf2aeaf089fa5dc0b21d 100644 (file)
@@ -97,7 +97,7 @@ public:
   bool is_synced() const { return synced; }
   void wait_for_sync(MDSInternalContextBase *c) {
     assert(!synced);
-    waiting_for_version[MAX(cached_version, 1)].push_back(c);
+    waiting_for_version[std::max<version_t>(cached_version, 1)].push_back(c);
   }
 
   snapid_t get_last_created() const { return cached_last_created; }
index 055d243a74c80c838ba0cb04274e50b01d1f442a..935880a2449d9ad13231200ff331ede8316ba083 100644 (file)
@@ -303,7 +303,7 @@ void SnapRealm::check_cache() const
   snapid_t last_destroyed = mdcache->mds->snapclient->get_last_destroyed();
   if (global || srnode.is_parent_global()) {
     last_created = mdcache->mds->snapclient->get_last_created();
-    seq = MAX(last_created, last_destroyed);
+    seq = std::max(last_created, last_destroyed);
   } else {
     last_created = srnode.last_created;
     seq = srnode.seq;