]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: encode source mds in MDirUpdate
authorSage Weil <sage@newdream.net>
Mon, 22 Mar 2010 16:12:10 +0000 (09:12 -0700)
committerSage Weil <sage@newdream.net>
Mon, 22 Mar 2010 18:09:24 +0000 (11:09 -0700)
Not that it's actually used, but just in case.

src/mds/MDCache.cc
src/messages/MDirUpdate.h

index b981f84c8194b131e266b593b6bee2e2428ce5b8..b3cd9152a42f6f3a66a404b0f5cd410609203ede 100644 (file)
@@ -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,
index fe0d992512cada17cf7ed65f8a853737cc731991..d2830f45f2bdb63a417be627f4fdd9411a596250 100644 (file)
@@ -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<int>& 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<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;
@@ -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);