]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/osd_types: conditional pg_pool_t encoding
authorSage Weil <sage@redhat.com>
Wed, 23 Nov 2016 18:48:35 +0000 (13:48 -0500)
committerSage Weil <sage@redhat.com>
Wed, 23 Nov 2016 19:38:48 +0000 (14:38 -0500)
Align this with decode.

Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit 01d9e8a20bbc3c039f67b040da95018e2c7b00b6)

src/osd/osd_types.cc

index b9222fed117ed2ea24f3c3351cfd9da5bc916ce6..55eba9d972d3df2f1e43a20cdc665a15a8d168c5 100644 (file)
@@ -1493,7 +1493,8 @@ void pg_pool_t::encode(bufferlist& bl, uint64_t features) const
     return;
   }
 
-  ENCODE_START(24, 5, bl);
+  uint8_t v = 24;
+  ENCODE_START(v, 5, bl);
   ::encode(type, bl);
   ::encode(size, bl);
   ::encode(crush_ruleset, bl);
@@ -1535,13 +1536,25 @@ void pg_pool_t::encode(bufferlist& bl, uint64_t features) const
   ::encode(last_force_op_resend, bl);
   ::encode(min_read_recency_for_promote, bl);
   ::encode(expected_num_objects, bl);
-  ::encode(cache_target_dirty_high_ratio_micro, bl);
-  ::encode(min_write_recency_for_promote, bl);
-  ::encode(use_gmt_hitset, bl);
-  ::encode(fast_read, bl);
-  ::encode(hit_set_grade_decay_rate, bl);
-  ::encode(hit_set_search_last_n, bl);
-  ::encode(opts, bl);
+  if (v >= 19) {
+    ::encode(cache_target_dirty_high_ratio_micro, bl);
+  }
+  if (v >= 20) {
+    ::encode(min_write_recency_for_promote, bl);
+  }
+  if (v >= 21) {
+    ::encode(use_gmt_hitset, bl);
+  }
+  if (v >= 22) {
+    ::encode(fast_read, bl);
+  }
+  if (v >= 23) {
+    ::encode(hit_set_grade_decay_rate, bl);
+    ::encode(hit_set_search_last_n, bl);
+  }
+  if (v >= 24) {
+    ::encode(opts, bl);
+  }
   ENCODE_FINISH(bl);
 }