From 6a0d0d0612be77a3bc8214060caae305ea9f97f5 Mon Sep 17 00:00:00 2001 From: Greg Farnum Date: Fri, 16 Apr 2010 12:28:56 -0700 Subject: [PATCH] msg: Remove "asker" data member from MDiscover. Fix uses. --- src/mds/MDCache.cc | 17 ++++++----------- src/messages/MDiscover.h | 12 ++---------- 2 files changed, 8 insertions(+), 21 deletions(-) diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index 22a08a01760fc..fecd9b9dd417e 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -7151,8 +7151,7 @@ void MDCache::discover_base_ino(inodeno_t want_ino, dout(7) << "discover_base_ino " << want_ino << " from mds" << from << dendl; if (waiting_for_base_ino[from].count(want_ino) == 0) { filepath want_path; - MDiscover *dis = new MDiscover(mds->get_nodeid(), - want_ino, + MDiscover *dis = new MDiscover(want_ino, CEPH_NOSNAP, want_path, false); @@ -7175,8 +7174,7 @@ void MDCache::discover_dir_frag(CInode *base, if (!base->is_waiter_for(CInode::WAIT_DIR) || !onfinish) { // this is overly conservative filepath want_path; - MDiscover *dis = new MDiscover(mds->get_nodeid(), - base->ino(), + MDiscover *dis = new MDiscover(base->ino(), CEPH_NOSNAP, want_path, true); // need the base dir open @@ -7210,8 +7208,7 @@ void MDCache::discover_path(CInode *base, } if (!base->is_waiter_for(CInode::WAIT_DIR) || !onfinish) { // this is overly conservative - MDiscover *dis = new MDiscover(mds->get_nodeid(), - base->ino(), + MDiscover *dis = new MDiscover(base->ino(), snap, want_path, true, // we want the base dir; we are relative to ino. @@ -7243,8 +7240,7 @@ void MDCache::discover_path(CDir *base, } if (!base->is_waiting_for_dentry(want_path[0].c_str(), snap) || !onfinish) { - MDiscover *dis = new MDiscover(mds->get_nodeid(), - base->ino(), + MDiscover *dis = new MDiscover(base->ino(), snap, want_path, false, // no base dir; we are relative to dir @@ -7275,8 +7271,7 @@ void MDCache::discover_ino(CDir *base, } if (!base->is_waiting_for_ino(want_ino)) { - MDiscover *dis = new MDiscover(mds->get_nodeid(), - base->dirfrag(), + MDiscover *dis = new MDiscover(base->dirfrag(), CEPH_NOSNAP, want_ino, want_xlocked); @@ -7330,7 +7325,7 @@ void MDCache::kick_discovers(int who) void MDCache::handle_discover(MDiscover *dis) { int whoami = mds->get_nodeid(); - int from = dis->get_asker(); + int from = dis->get_source_inst().name._num; assert(from != whoami); diff --git a/src/messages/MDiscover.h b/src/messages/MDiscover.h index a51b13c2a76b2..53d05557ac687 100644 --- a/src/messages/MDiscover.h +++ b/src/messages/MDiscover.h @@ -25,7 +25,6 @@ using namespace std; class MDiscover : public Message { - __s32 asker; inodeno_t base_ino; // 1 -> root frag_t base_dir_frag; @@ -37,7 +36,6 @@ class MDiscover : public Message { bool want_xlocked; public: - int get_asker() { return asker; } inodeno_t get_base_ino() { return base_ino; } frag_t get_base_dir_frag() { return base_dir_frag; } snapid_t get_snapid() { return snapid; } @@ -52,27 +50,23 @@ class MDiscover : public Message { void set_base_dir_frag(frag_t f) { base_dir_frag = f; } MDiscover() { } - MDiscover(int asker_, - inodeno_t base_ino_, + MDiscover(inodeno_t base_ino_, snapid_t s, filepath& want_, bool want_base_dir_ = true, bool discover_xlocks_ = false) : Message(MSG_MDS_DISCOVER), - asker(asker_), base_ino(base_ino_), snapid(s), want(want_), want_ino(0), want_base_dir(want_base_dir_), want_xlocked(discover_xlocks_) { } - MDiscover(int asker_, - dirfrag_t base_dirfrag, + MDiscover(dirfrag_t base_dirfrag, snapid_t s, inodeno_t want_ino_, bool want_base_dir_ = true) : Message(MSG_MDS_DISCOVER), - asker(asker_), base_ino(base_dirfrag.ino), base_dir_frag(base_dirfrag.frag), snapid(s), @@ -93,7 +87,6 @@ public: void decode_payload() { bufferlist::iterator p = payload.begin(); - ::decode(asker, p); ::decode(base_ino, p); ::decode(base_dir_frag, p); ::decode(snapid, p); @@ -103,7 +96,6 @@ public: ::decode(want_xlocked, p); } void encode_payload() { - ::encode(asker, payload); ::encode(base_ino, payload); ::encode(base_dir_frag, payload); ::encode(snapid, payload); -- 2.39.5