]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/OSD: bump up current version of encoding; conditionally encoding manifest into oi 15687/head
authorxie xingguo <xie.xingguo@zte.com.cn>
Wed, 14 Jun 2017 09:44:14 +0000 (17:44 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Thu, 15 Jun 2017 00:35:38 +0000 (08:35 +0800)
These versions shall match the corresponding encoding versions.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/osd/PrimaryLogPG.cc
src/osd/osd_types.cc
src/osd/osd_types.h

index bb578d8447bd8958befa91432e9ca8fc5b6ea3cb..9daa478d2d2730a78dd4b49bf4810ac67fec4118 100644 (file)
@@ -5961,6 +5961,7 @@ int PrimaryLogPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
          result = -EINVAL;
          break;
        }
+        oi.set_flag(object_info_t::FLAG_MANIFEST);
        oi.manifest.redirect_target = target;
        oi.manifest.type = object_manifest_t::TYPE_REDIRECT;
        t->truncate(soid, 0);
index dcfe790567ffd6615fdc2e92580fef758b385377..e2846c65da7ec4aabe4c2d583653ed3cf193dff1 100644 (file)
@@ -1581,7 +1581,7 @@ void pg_pool_t::encode(bufferlist& bl, uint64_t features) const
 
 void pg_pool_t::decode(bufferlist::iterator& bl)
 {
-  DECODE_START_LEGACY_COMPAT_LEN(24, 5, 5, bl);
+  DECODE_START_LEGACY_COMPAT_LEN(25, 5, 5, bl);
   ::decode(type, bl);
   ::decode(size, bl);
   ::decode(crush_ruleset, bl);
@@ -5057,14 +5057,16 @@ void object_info_t::encode(bufferlist& bl, uint64_t features) const
   ::encode(expected_object_size, bl);
   ::encode(expected_write_size, bl);
   ::encode(alloc_hint_flags, bl);
-  ::encode(manifest, bl);
+  if (has_manifest()) {
+    ::encode(manifest, bl);
+  }
   ENCODE_FINISH(bl);
 }
 
 void object_info_t::decode(bufferlist::iterator& bl)
 {
   object_locator_t myoloc;
-  DECODE_START_LEGACY_COMPAT_LEN(16, 8, 8, bl);
+  DECODE_START_LEGACY_COMPAT_LEN(17, 8, 8, bl);
   map<entity_name_t, watch_info_t> old_watchers;
   ::decode(soid, bl);
   ::decode(myoloc, bl);
@@ -5147,7 +5149,9 @@ void object_info_t::decode(bufferlist::iterator& bl)
     alloc_hint_flags = 0;
   }
   if (struct_v >= 17) {
-    ::decode(manifest, bl);
+    if (has_manifest()) {
+      ::decode(manifest, bl);
+    }
   }
   DECODE_FINISH(bl);
 }
index 3e2128e414ed864c755f6fdd5a19b04d6625dab3..124e40c82aa2a7bee2c6a9b6a194382745beddb0 100644 (file)
@@ -4508,6 +4508,8 @@ struct object_info_t {
       s += "|omap_digest";
     if (flags & FLAG_CACHE_PIN)
       s += "|cache_pin";
+    if (flags & FLAG_MANIFEST)
+      s += "|manifest";
     if (s.length())
       return s.substr(1);
     return s;
@@ -4569,7 +4571,7 @@ struct object_info_t {
     return test_flag(FLAG_CACHE_PIN);
   }
   bool has_manifest() const {
-    return !manifest.is_empty();
+    return test_flag(FLAG_MANIFEST);
   }
 
   void set_data_digest(__u32 d) {