From aa4ab12c64a411a87c4e030e9e280dea19ab23b9 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 14 Sep 2016 13:54:14 -0400 Subject: [PATCH] osd: denc_traits for osd_reqid_t Signed-off-by: Sage Weil --- src/osd/OpRequest.h | 11 ++++++++--- src/osd/osd_types.cc | 18 ------------------ 2 files changed, 8 insertions(+), 21 deletions(-) diff --git a/src/osd/OpRequest.h b/src/osd/OpRequest.h index 7982e1a44b461..a5db48dd6a644 100644 --- a/src/osd/OpRequest.h +++ b/src/osd/OpRequest.h @@ -39,12 +39,17 @@ struct osd_reqid_t { osd_reqid_t(const entity_name_t& a, int i, ceph_tid_t t) : name(a), tid(t), inc(i) {} - void encode(bufferlist &bl) const; - void decode(bufferlist::iterator &bl); + DENC(osd_reqid_t, v, p) { + DENC_START(2, 2, p); + denc(v.name, p); + denc(v.tid, p); + denc(v.inc, p); + DENC_FINISH(p); + } void dump(Formatter *f) const; static void generate_test_instances(list& o); }; -WRITE_CLASS_ENCODER(osd_reqid_t) +WRITE_CLASS_DENC(osd_reqid_t) /** * The OpRequest takes in a Message* and takes over a single reference diff --git a/src/osd/osd_types.cc b/src/osd/osd_types.cc index b29e17766e38c..f5510c776e9ff 100644 --- a/src/osd/osd_types.cc +++ b/src/osd/osd_types.cc @@ -161,24 +161,6 @@ ostream &operator<<(ostream &lhs, const pg_shard_t &rhs) } // -- osd_reqid_t -- -void osd_reqid_t::encode(bufferlist &bl) const -{ - ENCODE_START(2, 2, bl); - ::encode(name, bl); - ::encode(tid, bl); - ::encode(inc, bl); - ENCODE_FINISH(bl); -} - -void osd_reqid_t::decode(bufferlist::iterator &bl) -{ - DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl); - ::decode(name, bl); - ::decode(tid, bl); - ::decode(inc, bl); - DECODE_FINISH(bl); -} - void osd_reqid_t::dump(Formatter *f) const { f->dump_stream("name") << name; -- 2.39.5