From f8478e81052813042e029c23f7d04a5c68c35351 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 22 Mar 2010 09:12:10 -0700 Subject: [PATCH] mds: encode source mds in MDirUpdate Not that it's actually used, but just in case. --- src/mds/MDCache.cc | 3 ++- src/messages/MDirUpdate.h | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index b981f84c8194b..b3cd9152a42f6 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -7992,7 +7992,8 @@ int MDCache::send_dir_updates(CDir *dir, bool bcast) //if (*it == except) continue; dout(7) << "sending dir_update on " << *dir << " to " << *it << dendl; - mds->send_message_mds(new MDirUpdate(dir->dirfrag(), + mds->send_message_mds(new MDirUpdate(mds->get_nodeid(), + dir->dirfrag(), dir->dir_rep, dir->dir_rep_by, path, diff --git a/src/messages/MDirUpdate.h b/src/messages/MDirUpdate.h index fe0d992512cad..d2830f45f2bdb 100644 --- a/src/messages/MDirUpdate.h +++ b/src/messages/MDirUpdate.h @@ -19,6 +19,7 @@ #include "msg/Message.h" class MDirUpdate : public Message { + int32_t from_mds; dirfrag_t dirfrag; int32_t dir_rep; int32_t discover; @@ -26,6 +27,7 @@ class MDirUpdate : public Message { filepath path; public: + int get_source_mds() { return from_mds; } dirfrag_t get_dirfrag() { return dirfrag; } int get_dir_rep() { return dir_rep; } set& get_dir_rep_by() { return dir_rep_by; } @@ -37,12 +39,14 @@ class MDirUpdate : public Message { } MDirUpdate() {} - MDirUpdate(dirfrag_t dirfrag, + MDirUpdate(int f, + dirfrag_t dirfrag, int dir_rep, set& dir_rep_by, filepath& path, bool discover = false) : Message(MSG_MDS_DIRUPDATE) { + this->from_mds = f; this->dirfrag = dirfrag; this->dir_rep = dir_rep; this->dir_rep_by = dir_rep_by; @@ -56,6 +60,7 @@ class MDirUpdate : public Message { virtual void decode_payload() { bufferlist::iterator p = payload.begin(); + ::decode(from_mds, p); ::decode(dirfrag, p); ::decode(dir_rep, p); ::decode(discover, p); @@ -64,6 +69,7 @@ class MDirUpdate : public Message { } virtual void encode_payload() { + ::encode(from_mds, payload); ::encode(dirfrag, payload); ::encode(dir_rep, payload); ::encode(discover, payload); -- 2.39.5