From 49b0be58154a3d5d8970d8af5d11121f7f75c74a Mon Sep 17 00:00:00 2001 From: Greg Farnum Date: Wed, 16 Jan 2013 15:56:05 -0800 Subject: [PATCH] mds: rename MDSTableServer::_pending to mds_table_pending_t And move it from MDSTableServer into mdstypes.cc, so we can use it in ceph-dencoder more gracefully (coming up next!). Signed-off-by: Greg Farnum --- src/mds/MDSTableServer.cc | 2 +- src/mds/MDSTableServer.h | 27 +-------------------------- src/mds/mdstypes.h | 26 ++++++++++++++++++++++++++ 3 files changed, 28 insertions(+), 27 deletions(-) diff --git a/src/mds/MDSTableServer.cc b/src/mds/MDSTableServer.cc index 7175bbb3cfe73..6eadd82a5001f 100644 --- a/src/mds/MDSTableServer.cc +++ b/src/mds/MDSTableServer.cc @@ -156,7 +156,7 @@ void MDSTableServer::handle_mds_recovery(int who) dout(7) << "handle_mds_recovery mds." << who << dendl; // resend agrees for recovered mds - for (map::iterator p = pending_for_mds.begin(); + for (map::iterator p = pending_for_mds.begin(); p != pending_for_mds.end(); p++) { if (who >= 0 && p->second.mds != who) diff --git a/src/mds/MDSTableServer.h b/src/mds/MDSTableServer.h index 1467263d8b79a..26cd5944844b2 100644 --- a/src/mds/MDSTableServer.h +++ b/src/mds/MDSTableServer.h @@ -22,31 +22,7 @@ class MMDSTableRequest; class MDSTableServer : public MDSTable { public: int table; - - /* mds's requesting any pending ops. child needs to encodig the corresponding - * pending mutation state in the table. - */ - struct _pending { - uint64_t reqid; - __s32 mds; - version_t tid; - void encode(bufferlist& bl) const { - __u8 struct_v = 1; - ::encode(struct_v, bl); - ::encode(reqid, bl); - ::encode(mds, bl); - ::encode(tid, bl); - } - void decode(bufferlist::iterator& bl) { - __u8 struct_v; - ::decode(struct_v, bl); - ::decode(reqid, bl); - ::decode(mds, bl); - ::decode(tid, bl); - } - }; - WRITE_CLASS_ENCODER(_pending) - map pending_for_mds; // ** child should encode this! ** + map pending_for_mds; // ** child should encode this! ** private: @@ -117,6 +93,5 @@ private: void finish_recovery(); void handle_mds_recovery(int who); }; -WRITE_CLASS_ENCODER(MDSTableServer::_pending) #endif diff --git a/src/mds/mdstypes.h b/src/mds/mdstypes.h index c9c30e3488ed2..32439ffaffd11 100644 --- a/src/mds/mdstypes.h +++ b/src/mds/mdstypes.h @@ -615,6 +615,32 @@ inline ostream& operator<<(ostream& out, const string_snap_t &k) return out << "(" << k.name << "," << k.snapid << ")"; } +/* + * mds_table_pending_t + * + * mds's requesting any pending ops. child needs to encode the corresponding + * pending mutation state in the table. + */ +struct mds_table_pending_t { + uint64_t reqid; + __s32 mds; + version_t tid; + void encode(bufferlist& bl) const { + __u8 struct_v = 1; + ::encode(struct_v, bl); + ::encode(reqid, bl); + ::encode(mds, bl); + ::encode(tid, bl); + } + void decode(bufferlist::iterator& bl) { + __u8 struct_v; + ::decode(struct_v, bl); + ::decode(reqid, bl); + ::decode(mds, bl); + ::decode(tid, bl); + } +}; +WRITE_CLASS_ENCODER(mds_table_pending_t) // ========= -- 2.39.5