Skip to content

Commit

Permalink
mds: encode source mds in MDirUpdate
Browse files Browse the repository at this point in the history
Not that it's actually used, but just in case.
  • Loading branch information
liewegas committed Mar 22, 2010
1 parent 1ad3434 commit f8478e8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/mds/MDCache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 7 additions & 1 deletion src/messages/MDirUpdate.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@
#include "msg/Message.h"

class MDirUpdate : public Message {
int32_t from_mds;
dirfrag_t dirfrag;
int32_t dir_rep;
int32_t discover;
set<int32_t> dir_rep_by;
filepath path;

public:
int get_source_mds() { return from_mds; }
dirfrag_t get_dirfrag() { return dirfrag; }
int get_dir_rep() { return dir_rep; }
set<int>& get_dir_rep_by() { return dir_rep_by; }
Expand All @@ -37,12 +39,14 @@ class MDirUpdate : public Message {
}

MDirUpdate() {}
MDirUpdate(dirfrag_t dirfrag,
MDirUpdate(int f,
dirfrag_t dirfrag,
int dir_rep,
set<int>& 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;
Expand All @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit f8478e8

Please sign in to comment.