]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: change MMDSMap to send map we have, not map we want.
authorSage Weil <sage@newdream.net>
Wed, 24 Jun 2009 20:03:31 +0000 (13:03 -0700)
committerSage Weil <sage@newdream.net>
Wed, 24 Jun 2009 20:15:33 +0000 (13:15 -0700)
src/include/ceph_fs.h
src/kernel/mon_client.c
src/messages/MMDSGetMap.h
src/mon/MDSMonitor.cc

index c9507ffc45f1ff236113f5ae2f14a8a975292d7e..4036c4af23b74c6fd764921bee9a2a76a4e09ea6 100644 (file)
@@ -305,8 +305,8 @@ struct ceph_osd_getmap {
 } __attribute__ ((packed));
 
 struct ceph_mds_getmap {
+       __le64 have;
        ceph_fsid_t fsid;
-       __le32 want;
 } __attribute__ ((packed));
 
 
index 5b4e5e9711e054ae13a62ff6fdfb4e3884f4768f..b3d392840358cd36e941d5a523c2c4108c8fb070 100644 (file)
@@ -140,7 +140,7 @@ static void request_mdsmap(struct ceph_mon_client *monc, int newmon)
                return;
        h = msg->front.iov_base;
        h->fsid = monc->monmap->fsid;
-       h->want = cpu_to_le32(monc->want_mdsmap);
+       h->have = cpu_to_le64(monc->want_mdsmap - 1);
        msg->hdr.dst = monc->monmap->mon_inst[mon];
        ceph_msg_send(monc->client->msgr, msg, 0);
 }
index f811a8a3b81cadd98123a6d5cad5bd5a6364d301..7d4f31ba0033ec298201960340b788ba0a515d75 100644 (file)
 class MMDSGetMap : public PaxosServiceMessage {
  public:
   ceph_fsid_t fsid;
-  epoch_t want;
 
   MMDSGetMap() : PaxosServiceMessage(CEPH_MSG_MDS_GETMAP, 0) {}
-  MMDSGetMap(ceph_fsid_t &f, epoch_t w=0) : 
-    PaxosServiceMessage(CEPH_MSG_MDS_GETMAP, w-1), 
-    fsid(f),
-    want(w) { }
+  MMDSGetMap(ceph_fsid_t &f, epoch_t have=0) : 
+    PaxosServiceMessage(CEPH_MSG_MDS_GETMAP, have), 
+    fsid(f) { }
 
   const char *get_type_name() { return "mds_getmap"; }
   void print(ostream& out) {
-    out << "mds_getmap(want " << want << "v " << version << ")";
+    out << "mds_getmap(have v" << version << ")";
   }
   
   void encode_payload() {
     paxos_encode();
     ::encode(fsid, payload);
-    ::encode(want, payload);
   }
   void decode_payload() {
     bufferlist::iterator p = payload.begin();
     paxos_decode(p);
     ::decode(fsid, p);
-    ::decode(want, p);
   }
 };
 
index 51e81066670fa0086f02b321f16a54fe81a78fb0..6ddc2f4ef58cdf63b9eed2c85fb14e8594d770d1 100644 (file)
@@ -150,7 +150,7 @@ bool MDSMonitor::preprocess_query(PaxosServiceMessage *m)
 
 void MDSMonitor::handle_mds_getmap(MMDSGetMap *m)
 {
-  if (m->want <= mdsmap.get_epoch())
+  if (m->version < mdsmap.get_epoch())
     send_full(m->get_orig_source_inst());
   else
     waiting_for_map.push_back(m->get_orig_source_inst());