]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd_types: define max in eversion_t::max() to static 17453/head
authoryang.wang <yang.wang@easystack.cn>
Mon, 4 Sep 2017 12:20:11 +0000 (20:20 +0800)
committeryang.wang <yang.wang@easystack.cn>
Tue, 5 Sep 2017 10:50:11 +0000 (18:50 +0800)
max in eversion_t::max() can be static, no need to re constructs
it every time when calling eversion_t::max(), and max can be
constructed using eversion_t(epoch_t e, version_t v), it better than
firstly construct it by eversion_t() and then reassign it to (-1,-1)

Change-Id: I85de5685024e61ebc2d1816b0969be67bdaf45f5
Signed-off-by: yang.wang yang.wang@easystack.cn
src/osd/osd_types.h

index 8934910566f85fc808cefce8e4d60a0149008806..6de4d40d714bc1566e85ae665a6f7d6eef4a84aa 100644 (file)
@@ -795,10 +795,8 @@ public:
 
   explicit eversion_t(bufferlist& bl) : __pad(0) { decode(bl); }
 
-  static eversion_t max() {
-    eversion_t max;
-    max.version -= 1;
-    max.epoch -= 1;
+  static const eversion_t& max() {
+    static const eversion_t max(-1,-1);
     return max;
   }