From: Sage Weil Date: Mon, 16 May 2016 14:11:46 +0000 (-0400) Subject: osd: encode watch_info_t with features X-Git-Tag: v11.0.0~270^2~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=40f93dd870bd2a14068f03a9a9d6f486619c7c5a;p=ceph.git osd: encode watch_info_t with features Signed-off-by: Sage Weil --- diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 592ad210a452..52a259554eae 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -4780,7 +4780,7 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector& ops) resp.entries.push_back(wi); } - resp.encode(osd_op.outdata); + resp.encode(osd_op.outdata, ctx->get_features()); result = 0; ctx->delta_stats.num_rd++; diff --git a/src/osd/osd_types.cc b/src/osd/osd_types.cc index 802b41d222e8..293d796721d3 100644 --- a/src/osd/osd_types.cc +++ b/src/osd/osd_types.cc @@ -4610,12 +4610,12 @@ SnapSet SnapSet::get_filtered(const pg_pool_t &pinfo) const // -- watch_info_t -- -void watch_info_t::encode(bufferlist& bl) const +void watch_info_t::encode(bufferlist& bl, uint64_t features) const { ENCODE_START(4, 3, bl); ::encode(cookie, bl); ::encode(timeout_seconds, bl); - ::encode(addr, bl); + ::encode(addr, bl, features); ENCODE_FINISH(bl); } @@ -4717,13 +4717,13 @@ void object_info_t::encode(bufferlist& bl, uint64_t features) const ::encode(truncate_seq, bl); ::encode(truncate_size, bl); ::encode(is_lost(), bl); - ::encode(old_watchers, bl); + ::encode(old_watchers, bl, features); /* shenanigans to avoid breaking backwards compatibility in the disk format. * When we can, switch this out for simply putting the version_t on disk. */ eversion_t user_eversion(0, user_version); ::encode(user_eversion, bl); ::encode(test_flag(FLAG_USES_TMAP), bl); - ::encode(watchers, bl); + ::encode(watchers, bl, features); __u32 _flags = flags; ::encode(_flags, bl); ::encode(local_mtime, bl); diff --git a/src/osd/osd_types.h b/src/osd/osd_types.h index 5f8bb292a4d8..bbcaf439d537 100644 --- a/src/osd/osd_types.h +++ b/src/osd/osd_types.h @@ -3171,12 +3171,12 @@ struct watch_info_t { watch_info_t() : cookie(0), timeout_seconds(0) { } watch_info_t(uint64_t c, uint32_t t, const entity_addr_t& a) : cookie(c), timeout_seconds(t), addr(a) {} - void encode(bufferlist& bl) const; + void encode(bufferlist& bl, uint64_t features) const; void decode(bufferlist::iterator& bl); void dump(Formatter *f) const; static void generate_test_instances(list& o); }; -WRITE_CLASS_ENCODER(watch_info_t) +WRITE_CLASS_ENCODER_FEATURES(watch_info_t) static inline bool operator==(const watch_info_t& l, const watch_info_t& r) { return l.cookie == r.cookie && l.timeout_seconds == r.timeout_seconds @@ -4077,12 +4077,12 @@ struct watch_item_t { : name(name), cookie(cookie), timeout_seconds(timeout), addr(addr) { } - void encode(bufferlist &bl) const { + void encode(bufferlist &bl, uint64_t features) const { ENCODE_START(2, 1, bl); ::encode(name, bl); ::encode(cookie, bl); ::encode(timeout_seconds, bl); - ::encode(addr, bl); + ::encode(addr, bl, features); ENCODE_FINISH(bl); } void decode(bufferlist::iterator &bl) { @@ -4096,7 +4096,7 @@ struct watch_item_t { DECODE_FINISH(bl); } }; -WRITE_CLASS_ENCODER(watch_item_t) +WRITE_CLASS_ENCODER_FEATURES(watch_item_t) struct obj_watch_item_t { hobject_t obj; @@ -4110,9 +4110,9 @@ struct obj_watch_item_t { struct obj_list_watch_response_t { list entries; - void encode(bufferlist& bl) const { + void encode(bufferlist& bl, uint64_t features) const { ENCODE_START(1, 1, bl); - ::encode(entries, bl); + ::encode(entries, bl, features); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { @@ -4152,8 +4152,7 @@ struct obj_list_watch_response_t { o.back()->entries.push_back(watch_item_t(entity_name_t(entity_name_t::TYPE_CLIENT, 2), 20, 60, ea)); } }; - -WRITE_CLASS_ENCODER(obj_list_watch_response_t) +WRITE_CLASS_ENCODER_FEATURES(obj_list_watch_response_t) struct clone_info { snapid_t cloneid; diff --git a/src/test/encoding/types.h b/src/test/encoding/types.h index 87126a9edfad..9c7e70ee3d25 100644 --- a/src/test/encoding/types.h +++ b/src/test/encoding/types.h @@ -77,7 +77,7 @@ TYPE(pg_nls_response_t) TYPE(object_copy_cursor_t) TYPE_FEATUREFUL(object_copy_data_t) TYPE(pg_create_t) -TYPE(watch_info_t) +TYPE_FEATUREFUL(watch_info_t) TYPE_FEATUREFUL(object_info_t) TYPE(SnapSet) TYPE_FEATUREFUL(ObjectRecoveryInfo)