From 86b9b7ab2f3e1da15b2148b2f60ed5fcdc8830e3 Mon Sep 17 00:00:00 2001 From: Varsha Rao Date: Thu, 24 Oct 2019 15:09:23 +0530 Subject: [PATCH] mds: Reorganize class members in MDSTableClient header Fixes: https://tracker.ceph.com/issues/42461 Signed-off-by: Varsha Rao --- src/mds/MDSTableClient.h | 66 +++++++++++++++++++--------------------- 1 file changed, 31 insertions(+), 35 deletions(-) diff --git a/src/mds/MDSTableClient.h b/src/mds/MDSTableClient.h index 75326c2f121..2952ec4069d 100644 --- a/src/mds/MDSTableClient.h +++ b/src/mds/MDSTableClient.h @@ -25,41 +25,9 @@ class MDSRank; class LogSegment; class MDSTableClient { -protected: - MDSRank *mds; - int table; - - uint64_t last_reqid; - - bool server_ready; - - // prepares - struct _pending_prepare { - MDSContext *onfinish; - version_t *ptid; - bufferlist *pbl; - bufferlist mutation; - - _pending_prepare() : onfinish(0), ptid(0), pbl(0) {} - _pending_prepare(MDSContext *c, version_t *pt, bufferlist *pb, bufferlist& m) : - onfinish(c), ptid(pt), pbl(pb), mutation(m) {} - }; - - map pending_prepare; - map prepared_update; - list<_pending_prepare> waiting_for_reqid; - - // pending commits - map pending_commit; - map ack_waiters; - - void handle_reply(class MMDSTableQuery *m); - void _logged_ack(version_t tid); - friend class C_LoggedAck; - public: MDSTableClient(MDSRank *m, int tab) : - mds(m), table(tab), last_reqid(~0ULL), server_ready(false) {} + mds(m), table(tab) {} virtual ~MDSTableClient() {} void handle_request(const cref_t &m); @@ -95,9 +63,37 @@ public: virtual void handle_query_result(const cref_t &m) = 0; virtual void handle_notify_prep(const cref_t &m) = 0; virtual void notify_commit(version_t tid) = 0; +protected: + // prepares + struct _pending_prepare { + _pending_prepare() {} + _pending_prepare(MDSContext *c, version_t *pt, bufferlist *pb, bufferlist& m) : + onfinish(c), ptid(pt), pbl(pb), mutation(m) {} + + MDSContext *onfinish = nullptr; + version_t *ptid = nullptr; + bufferlist *pbl = nullptr; + bufferlist mutation; + }; + + friend class C_LoggedAck; - // and friendly front-end for _prepare. + void handle_reply(class MMDSTableQuery *m); + void _logged_ack(version_t tid); -}; + MDSRank *mds; + int table; + + uint64_t last_reqid = ~0ULL; + + bool server_ready = false; + + map pending_prepare; + map prepared_update; + list<_pending_prepare> waiting_for_reqid; + // pending commits + map pending_commit; + map ack_waiters; +}; #endif -- 2.39.5