]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
change ceph_fsid
authorSage Weil <sage@newdream.net>
Tue, 23 Dec 2008 21:39:25 +0000 (13:39 -0800)
committerSage Weil <sage@newdream.net>
Tue, 23 Dec 2008 21:39:25 +0000 (13:39 -0800)
Make it look more like uuid_t.  Rename type, comparator.

30 files changed:
src/TODO
src/cosd.cc
src/include/ceph_fs.h
src/include/types.h
src/messages/MLog.h
src/messages/MMDSBeacon.h
src/messages/MMDSGetMap.h
src/messages/MMDSMap.h
src/messages/MMonCommand.h
src/messages/MMonObserve.h
src/messages/MOSDFailure.h
src/messages/MOSDGetMap.h
src/messages/MOSDMap.h
src/messages/MOSDPing.h
src/messages/MOSDScrub.h
src/messages/MPGStats.h
src/messages/MStatfs.h
src/messages/MStatfsReply.h
src/mon/LogMonitor.cc
src/mon/MDSMonitor.cc
src/mon/MonMap.h
src/mon/Monitor.cc
src/mon/OSDMonitor.cc
src/mon/PGMonitor.cc
src/osd/OSD.cc
src/osd/OSD.h
src/osd/OSDMap.cc
src/osd/OSDMap.h
src/osd/osd_types.h
src/osdc/Objecter.cc

index 250576cc454ad00d92901db20a73ea32b5626588..adbfb25d25d0e8ff9d066a28c1e1cb471a938203 100644 (file)
--- a/src/TODO
+++ b/src/TODO
@@ -22,7 +22,6 @@ big items
 - client, user authentication
 - cas
 - osd failure declarations
-- libuuid?
 
 
 repair
index 6972df4083d724235c279d81c3642e00a05c3e6d..1304d0da9fdd4ac5ed9c191c93e7d42cf2ee8b5c 100644 (file)
@@ -99,7 +99,7 @@ int main(int argc, const char **argv)
 
   if (whoami < 0) {
     nstring magic;
-    ceph_fsid fsid;
+    ceph_fsid_t fsid;
     int r = OSD::peek_super(dev, magic, fsid, whoami);
     if (r < 0) {
       cerr << "unable to determine OSD identity from superblock on " << dev << ": " << strerror(-r) << std::endl;
@@ -109,7 +109,7 @@ int main(int argc, const char **argv)
       cerr << "OSD magic " << magic << " != my " << CEPH_OSD_ONDISK_MAGIC << std::endl;
       exit(1);
     }
-    if (!ceph_fsid_equal(&fsid, &monmap.fsid)) {
+    if (ceph_fsid_compare(&fsid, &monmap.fsid)) {
       cerr << "OSD fsid " << fsid << " != monmap fsid " << monmap.fsid << std::endl;
       exit(1);
     }
index ed96845754077b5734441a89420dedc968b6bbe4..fc7c8dc755c835fd4d847c7d42023c6acd2f0004 100644 (file)
@@ -65,15 +65,12 @@ typedef __le32 ceph_epoch_t;
 /*
  * fs id
  */
-struct ceph_fsid {
-       __le64 major;
-       __le64 minor;
-} __attribute__ ((packed));
+typedef struct { unsigned char fsid[16]; } ceph_fsid_t;
 
-static inline int ceph_fsid_equal(const struct ceph_fsid *a,
-                                 const struct ceph_fsid *b)
+static inline int ceph_fsid_compare(const ceph_fsid_t *a,
+                                   const ceph_fsid_t *b)
 {
-       return a->major == b->major && a->minor == b->minor;
+       return memcmp(a, b, sizeof(*a));
 }
 
 
@@ -541,7 +538,7 @@ struct ceph_msg_footer {
 
 
 struct ceph_mon_statfs {
-       struct ceph_fsid fsid;
+       ceph_fsid_t fsid;
        __le64 tid;
 };
 
@@ -553,18 +550,18 @@ struct ceph_statfs {
 };
 
 struct ceph_mon_statfs_reply {
-       struct ceph_fsid fsid;
+       ceph_fsid_t fsid;
        __le64 tid;
        struct ceph_statfs st;
 };
 
 struct ceph_osd_getmap {
-       struct ceph_fsid fsid;
+       ceph_fsid_t fsid;
        __le32 start;
 } __attribute__ ((packed));
 
 struct ceph_mds_getmap {
-       struct ceph_fsid fsid;
+       ceph_fsid_t fsid;
        __le32 want;
 } __attribute__ ((packed));
 
index 2bdde3903246f43ef838bf855024ccd79857b76b..eed004fa66ca92cca48508897680083b661c0eda 100644 (file)
@@ -197,7 +197,7 @@ struct ltstr
 
 #include "encoding.h"
 
-WRITE_RAW_ENCODER(ceph_fsid)
+WRITE_RAW_ENCODER(ceph_fsid_t)
 WRITE_RAW_ENCODER(ceph_file_layout)
 WRITE_RAW_ENCODER(ceph_mds_request_head)
 WRITE_RAW_ENCODER(ceph_mds_caps)
@@ -370,8 +370,12 @@ inline ostream& operator<<(ostream& out, const SnapContext& snapc) {
 
 // --
 
-inline ostream& operator<<(ostream& out, const ceph_fsid& f) {
-  return out << hex << f.major << '.' << f.minor << dec;
+inline ostream& operator<<(ostream& out, const ceph_fsid_t& f) {
+  char b[37];
+  sprintf(b, "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x",
+         f.fsid[0], f.fsid[1], f.fsid[2], f.fsid[3], f.fsid[4], f.fsid[5], f.fsid[6], f.fsid[7],
+         f.fsid[8], f.fsid[9], f.fsid[10], f.fsid[11], f.fsid[12], f.fsid[13], f.fsid[14], f.fsid[15]);
+  return out << b;
 }
 
 inline ostream& operator<<(ostream& out, const ceph_osd_op& op) {
index d92a0160b16bf0668e6293ab300e3e22fc5694f9..effa853238fdebe5d5ec3c1b27ca1fab07ab1d0a 100644 (file)
 
 class MLog : public Message {
 public:
-  ceph_fsid fsid;
+  ceph_fsid_t fsid;
   deque<LogEntry> entries;
   version_t last;
   
   MLog() : Message(MSG_PGSTATS) {}
-  MLog(ceph_fsid& f, deque<LogEntry>& e) : 
+  MLog(ceph_fsid_t& f, deque<LogEntry>& e) : 
     Message(MSG_LOG), fsid(f), entries(e), last(0) { }
-  MLog(ceph_fsid& f, version_t l) : 
+  MLog(ceph_fsid_t& f, version_t l) : 
     Message(MSG_LOG), fsid(f), last(l) {}
 
   const char *get_type_name() { return "log"; }
index b64f8ca0823d4f0ede6eaeb719412f06603ba8fa..168cc2122fe37e7a5c60c8bed0e707ff422d2238 100644 (file)
@@ -22,7 +22,7 @@
 #include "mds/MDSMap.h"
 
 class MMDSBeacon : public Message {
-  ceph_fsid fsid;
+  ceph_fsid_t fsid;
   epoch_t last_epoch_seen;  // include last mdsmap epoch mds has seen to avoid race with monitor decree
   __u32 state;
   version_t seq;
@@ -30,11 +30,11 @@ class MMDSBeacon : public Message {
 
  public:
   MMDSBeacon() : Message(MSG_MDS_BEACON) {}
-  MMDSBeacon(ceph_fsid &f, epoch_t les, int st, version_t se, int wr) : 
+  MMDSBeacon(ceph_fsid_t &f, epoch_t les, int st, version_t se, int wr) : 
     Message(MSG_MDS_BEACON), 
     fsid(f), last_epoch_seen(les), state(st), seq(se), want_rank(wr) { }
 
-  ceph_fsid& get_fsid() { return fsid; }
+  ceph_fsid_t& get_fsid() { return fsid; }
   epoch_t get_last_epoch_seen() { return last_epoch_seen; }
   int get_state() { return state; }
   version_t get_seq() { return seq; }
index e5fea016677ce788152263cf82349a6141ec2d6d..de39ec02a8f97b030d0d94f8af083fcbe2474cf4 100644 (file)
 
 class MMDSGetMap : public Message {
  public:
-  ceph_fsid fsid;
+  ceph_fsid_t fsid;
   epoch_t want;
 
   MMDSGetMap() {}
-  MMDSGetMap(ceph_fsid &f, epoch_t w=0) : 
+  MMDSGetMap(ceph_fsid_t &f, epoch_t w=0) : 
     Message(CEPH_MSG_MDS_GETMAP), 
     fsid(f),
     want(w) { }
index bfe4d114c32d0c9baaf274523b1f49a306745891..bcd0166b2e091ca47bf48bf963bbee026563db3f 100644 (file)
@@ -45,7 +45,7 @@ class MMDSMap : public Message {
   }
   */
   
-  ceph_fsid fsid;
+  ceph_fsid_t fsid;
   epoch_t epoch;
   bufferlist encoded;
 
@@ -54,7 +54,7 @@ class MMDSMap : public Message {
 
   MMDSMap() : 
     Message(CEPH_MSG_MDS_MAP) {}
-  MMDSMap(ceph_fsid &f, MDSMap *mm) :
+  MMDSMap(ceph_fsid_t &f, MDSMap *mm) :
     Message(CEPH_MSG_MDS_MAP),
     fsid(f) {
     epoch = mm->get_epoch();
index d5fdc78ad1523c89d16af7d59250fc1851f0a8da..4d7634c5906a902df7895e8e98c0d5b9fdbb1d01 100644 (file)
@@ -22,11 +22,11 @@ using std::vector;
 
 class MMonCommand : public Message {
  public:
-  ceph_fsid fsid;
+  ceph_fsid_t fsid;
   vector<string> cmd;
 
   MMonCommand() : Message(MSG_MON_COMMAND) {}
-  MMonCommand(ceph_fsid &f) : 
+  MMonCommand(ceph_fsid_t &f) : 
     Message(MSG_MON_COMMAND),
     fsid(f) { }
   
index ea0e2d512e2e672fac512a25553ffc6aa24a706c..2cff2e68a12b651f160c47c5276a198f3cc7d711 100644 (file)
@@ -22,12 +22,12 @@ using std::vector;
 
 class MMonObserve : public Message {
  public:
-  ceph_fsid fsid;
+  ceph_fsid_t fsid;
   uint32_t machine_id;
   version_t ver;
 
   MMonObserve() : Message(MSG_MON_OBSERVE) {}
-  MMonObserve(ceph_fsid &f, int mid, version_t v) : 
+  MMonObserve(ceph_fsid_t &f, int mid, version_t v) : 
     Message(MSG_MON_OBSERVE),
     fsid(f), machine_id(mid), ver(v) { }
   
index 850d74697132e44bc2bac31cbb035031b053d692..cabe3bd71e71f3fb0b12a78242d57b0268f27927 100644 (file)
 
 class MOSDFailure : public Message {
  public:
-  ceph_fsid fsid;
+  ceph_fsid_t fsid;
   entity_inst_t failed;
   epoch_t       epoch;
 
   MOSDFailure() : Message(MSG_OSD_FAILURE) {}
-  MOSDFailure(ceph_fsid &fs, entity_inst_t f, epoch_t e) : 
+  MOSDFailure(ceph_fsid_t &fs, entity_inst_t f, epoch_t e) : 
     Message(MSG_OSD_FAILURE),
     fsid(fs), failed(f), epoch(e) {}
  
index 15b6b9fff635cfb84052ca06be479ea42efcbab0..73c0a3c17bf5e6a37c7101c4930ac89fb81ab12e 100644 (file)
 
 class MOSDGetMap : public Message {
  public:
-  ceph_fsid fsid;
+  ceph_fsid_t fsid;
   epoch_t start;  // this is the first incremental the sender wants (he has start-1)
 
   MOSDGetMap() : Message(CEPH_MSG_OSD_GETMAP) {}
-  MOSDGetMap(ceph_fsid& f, epoch_t s=0) : 
+  MOSDGetMap(ceph_fsid_t& f, epoch_t s=0) : 
     Message(CEPH_MSG_OSD_GETMAP),
     fsid(f), start(s) { }
 
index 44574ae85881b46876b80d5dbc7651f6371654cf..c4c9874a6fa18ff744b51070eddd88bdb3ccd71f 100644 (file)
@@ -22,7 +22,7 @@
 
 class MOSDMap : public Message {
  public:
-  ceph_fsid fsid;
+  ceph_fsid_t fsid;
   map<epoch_t, bufferlist> maps;
   map<epoch_t, bufferlist> incremental_maps;
 
@@ -47,7 +47,7 @@ class MOSDMap : public Message {
 
 
   MOSDMap() : Message(CEPH_MSG_OSD_MAP) { }
-  MOSDMap(ceph_fsid &f, OSDMap *oc=0) : Message(CEPH_MSG_OSD_MAP),
+  MOSDMap(ceph_fsid_t &f, OSDMap *oc=0) : Message(CEPH_MSG_OSD_MAP),
                                      fsid(f) {
     if (oc)
       oc->encode(maps[oc->get_epoch()]);
index 226cf54f01c931771b4385de75d4bdffc959b0d3..b9e0a959bff5e4d9e9b9bfa866f3e96ee1dac717 100644 (file)
 
 class MOSDPing : public Message {
  public:
-  ceph_fsid fsid;
+  ceph_fsid_t fsid;
   epoch_t map_epoch, peer_as_of_epoch;
   bool ack;
   osd_peer_stat_t peer_stat;
 
-  MOSDPing(ceph_fsid& f, epoch_t e, epoch_t pe, osd_peer_stat_t& ps, bool a=false) : 
+  MOSDPing(ceph_fsid_t& f, epoch_t e, epoch_t pe, osd_peer_stat_t& ps, bool a=false) : 
     Message(MSG_OSD_PING), fsid(f), map_epoch(e), peer_as_of_epoch(pe), ack(a), peer_stat(ps) { }
   MOSDPing() {}
 
index 353ed77e10839468ca9a258d0322d34c59357dd8..d401e9582685f611fe54ac11619c3107388128d0 100644 (file)
  */
 
 struct MOSDScrub : public Message {
-  ceph_fsid fsid;
+  ceph_fsid_t fsid;
   vector<pg_t> scrub_pgs;
   bool repair;
 
   MOSDScrub() {}
-  MOSDScrub(ceph_fsid& f) :
+  MOSDScrub(ceph_fsid_t& f) :
     Message(MSG_OSD_SCRUB),
     fsid(f), repair(false) {}
-  MOSDScrub(ceph_fsid& f, vector<pg_t>& pgs, bool r) :
+  MOSDScrub(ceph_fsid_t& f, vector<pg_t>& pgs, bool r) :
     Message(MSG_OSD_SCRUB),
     fsid(f), scrub_pgs(pgs), repair(r) {}
 
index fba43df371474e1a49fe96c9d9eb4ab30e5c19fc..a347e272e7a50f4caf7f94cd9bb61820b89b09ce 100644 (file)
 
 class MPGStats : public Message {
 public:
-  ceph_fsid fsid;
+  ceph_fsid_t fsid;
   map<pg_t,pg_stat_t> pg_stat;
   osd_stat_t osd_stat;
   epoch_t epoch;
   utime_t had_map_for;
   
   MPGStats() : Message(MSG_PGSTATS) {}
-  MPGStats(ceph_fsid& f, epoch_t e, utime_t had) : 
+  MPGStats(ceph_fsid_t& f, epoch_t e, utime_t had) : 
     Message(MSG_PGSTATS), fsid(f), epoch(e), had_map_for(had) {}
 
   const char *get_type_name() { return "pg_stats"; }
index 79eb299146b697e7b9c2f706d264cdd20fc8e039..e44a965455814fda54a9aa5a70f7fc35d63517fd 100644 (file)
@@ -20,7 +20,7 @@
 
 class MStatfs : public Message {
 public:
-  ceph_fsid fsid;
+  ceph_fsid_t fsid;
   tid_t tid;
 
   MStatfs() : Message(CEPH_MSG_STATFS) {}
index 7e3ae365761cdd705e841bfe2280256bf6a379d3..9b24f0454b51b6ae554138e63a087af41850f08f 100644 (file)
@@ -21,7 +21,7 @@ public:
   struct ceph_mon_statfs_reply h;
 
   MStatfsReply() : Message(CEPH_MSG_STATFS_REPLY) {}
-  MStatfsReply(ceph_fsid &f, tid_t t) : Message(CEPH_MSG_STATFS_REPLY) {
+  MStatfsReply(ceph_fsid_t &f, tid_t t) : Message(CEPH_MSG_STATFS_REPLY) {
     h.fsid = f;
     h.tid = t;
   }
index 75989ae3d808b5bbe7223e28b3d56970c38dfee5..60adfafa78b23c87d32b22e3fd3ba2b0c55c632d 100644 (file)
@@ -211,7 +211,7 @@ bool LogMonitor::prepare_log(MLog *m)
 {
   dout(10) << "prepare_log " << *m << " from " << m->get_orig_source() << dendl;
 
-  if (!ceph_fsid_equal(&m->fsid, &mon->monmap->fsid)) {
+  if (ceph_fsid_compare(&m->fsid, &mon->monmap->fsid)) {
     dout(0) << "handle_log on fsid " << m->fsid << " != " << mon->monmap->fsid << dendl;
     delete m;
     return false;
index 57a50f56c4c4afd934974a77ac14e38fb823f44c..45da589b6b8fe18765dfd203a5d8039d153e688e 100644 (file)
@@ -159,7 +159,7 @@ bool MDSMonitor::preprocess_beacon(MMDSBeacon *m)
   version_t seq = m->get_seq();
   MDSMap::mds_info_t info;
 
-  if (!ceph_fsid_equal(&m->get_fsid(), &mon->monmap->fsid)) {
+  if (ceph_fsid_compare(&m->get_fsid(), &mon->monmap->fsid)) {
     dout(0) << "preprocess_beacon on fsid " << m->get_fsid() << " != " << mon->monmap->fsid << dendl;
     goto out;
   }
index e4aa4984370bb58f2fce052e19f620b223ec1a60..59d97ea5af755de4d9e678eace910169a70ac193 100644 (file)
@@ -24,7 +24,7 @@
 class MonMap {
  public:
   epoch_t epoch;       // what epoch/version of the monmap
-  ceph_fsid fsid;
+  ceph_fsid_t fsid;
   vector<entity_inst_t> mon_inst;
 
   int       last_mon;    // last mon i talked to
@@ -33,7 +33,7 @@ class MonMap {
     generate_fsid();
   }
 
-  ceph_fsid& get_fsid() { return fsid; }
+  ceph_fsid_t& get_fsid() { return fsid; }
 
   unsigned size() {
     return mon_inst.size();
@@ -99,8 +99,8 @@ class MonMap {
 
 
   void generate_fsid() {
-    fsid.major = ((uint64_t)rand() << 32) + rand();
-    fsid.minor = ((uint64_t)rand() << 32) + rand();
+    for (int i=0; i<16; i++)
+      fsid.fsid[i] = rand();
   }
 
   // read from/write to a file
index 06be66608f9d0848146545ab7bf93af40ca91949..f2797f7a1b60f38fe23b59dbafefc03e394c9e6f 100644 (file)
@@ -198,7 +198,7 @@ void Monitor::lose_election(epoch_t epoch, set<int> &q, int l)
 
 void Monitor::handle_command(MMonCommand *m)
 {
-  if (!ceph_fsid_equal(&m->fsid, &monmap->fsid)) {
+  if (ceph_fsid_compare(&m->fsid, &monmap->fsid)) {
     dout(0) << "handle_command on fsid " << m->fsid << " != " << monmap->fsid << dendl;
     reply_command(m, -EPERM, "wrong fsid");
     return;
index 0675bbf3e0d68024b359bc07c9b49d0c8b579fac..65095438dd4019c0d9d2f6dfc17c064c71d7fd56 100644 (file)
@@ -340,7 +340,7 @@ void OSDMonitor::handle_osd_getmap(MOSDGetMap *m)
          << " start " << m->get_start_epoch()
          << dendl;
   
-  if (!ceph_fsid_equal(&m->fsid, &mon->monmap->fsid)) {
+  if (ceph_fsid_compare(&m->fsid, &mon->monmap->fsid)) {
     dout(0) << "handle_osd_getmap on fsid " << m->fsid << " != " << mon->monmap->fsid << dendl;
     goto out;
   }
@@ -369,7 +369,7 @@ bool OSDMonitor::preprocess_failure(MOSDFailure *m)
   // who is failed
   int badboy = m->get_failed().name.num();
 
-  if (!ceph_fsid_equal(&m->fsid, &mon->monmap->fsid)) {
+  if (ceph_fsid_compare(&m->fsid, &mon->monmap->fsid)) {
     dout(0) << "preprocess_failure on fsid " << m->fsid << " != " << mon->monmap->fsid << dendl;
     goto didit;
   }
@@ -457,7 +457,7 @@ void OSDMonitor::_reported_failure(MOSDFailure *m)
 
 bool OSDMonitor::preprocess_boot(MOSDBoot *m)
 {
-  if (!ceph_fsid_equal(&m->sb.fsid, &mon->monmap->fsid)) {
+  if (ceph_fsid_compare(&m->sb.fsid, &mon->monmap->fsid)) {
     dout(0) << "preprocess_boot on fsid " << m->sb.fsid << " != " << mon->monmap->fsid << dendl;
     delete m;
     return true;
@@ -974,7 +974,7 @@ bool OSDMonitor::prepare_command(MMonCommand *m)
     else if (m->cmd[1] == "setmap") {
       OSDMap map;
       map.decode(m->get_data());
-      if (ceph_fsid_equal(&map.fsid, &mon->monmap->fsid)) {
+      if (ceph_fsid_compare(&map.fsid, &mon->monmap->fsid) == 0) {
        map.epoch = pending_inc.epoch;  // make sure epoch is correct
        map.encode(pending_inc.fullmap);
        string rs = "set osd map";
index f0b16c7cbc2feaf3e1470d1a1cf6574b1f225e09..d13f4568d139b9fb397557a72e76f13b1c436633 100644 (file)
@@ -203,7 +203,7 @@ void PGMonitor::handle_statfs(MStatfs *statfs)
 
   dout(10) << "handle_statfs " << *statfs << " from " << statfs->get_orig_source() << dendl;
 
-  if (!ceph_fsid_equal(&statfs->fsid, &mon->monmap->fsid)) {
+  if (ceph_fsid_compare(&statfs->fsid, &mon->monmap->fsid)) {
     dout(0) << "handle_statfs on fsid " << statfs->fsid << " != " << mon->monmap->fsid << dendl;
     goto out;
   }
@@ -261,7 +261,7 @@ bool PGMonitor::prepare_pg_stats(MPGStats *stats)
   dout(10) << "prepare_pg_stats " << *stats << " from " << stats->get_orig_source() << dendl;
   int from = stats->get_orig_source().num();
 
-  if (!ceph_fsid_equal(&stats->fsid, &mon->monmap->fsid)) {
+  if (ceph_fsid_compare(&stats->fsid, &mon->monmap->fsid)) {
     dout(0) << "handle_statfs on fsid " << stats->fsid << " != " << mon->monmap->fsid << dendl;
     delete stats;
     return false;
index d11a0d475821518b0728e2d47736f1e1fa952040..c1aa6b63846a2f3cdaa2b2ce75e54ee69fb74ce5 100644 (file)
@@ -149,7 +149,7 @@ ObjectStore *OSD::create_object_store(const char *dev)
 }
 
 
-int OSD::mkfs(const char *dev, ceph_fsid fsid, int whoami)
+int OSD::mkfs(const char *dev, ceph_fsid_t fsid, int whoami)
 {
   ObjectStore *store = create_object_store(dev);
   if (!store)
@@ -217,7 +217,7 @@ int OSD::mkfs(const char *dev, ceph_fsid fsid, int whoami)
   return 0;
 }
 
-int OSD::peek_super(const char *dev, nstring& magic, ceph_fsid& fsid, int& whoami)
+int OSD::peek_super(const char *dev, nstring& magic, ceph_fsid_t& fsid, int& whoami)
 {
   ObjectStore *store = create_object_store(dev);
   if (!store)
@@ -561,7 +561,7 @@ int OSD::read_superblock()
 
   dout(10) << "read_superblock " << superblock << dendl;
 
-  if (!ceph_fsid_equal(&superblock.fsid, &monmap->fsid)) {
+  if (ceph_fsid_compare(&superblock.fsid, &monmap->fsid)) {
     derr(0) << "read_superblock fsid " << superblock.fsid << " != monmap " << monmap->fsid << dendl;
     return -1;
   }
@@ -982,7 +982,7 @@ void OSD::handle_osd_ping(MOSDPing *m)
     return;
   }
 
-  if (!ceph_fsid_equal(&superblock.fsid, &m->fsid)) {
+  if (ceph_fsid_compare(&superblock.fsid, &m->fsid)) {
     dout(20) << "handle_osd_ping from " << m->get_source()
             << " bad fsid " << m->fsid << " != " << superblock.fsid << dendl;
     delete m;
@@ -1633,7 +1633,7 @@ void OSD::handle_scrub(MOSDScrub *m)
 {
   dout(10) << "handle_scrub " << *m << dendl;
   
-  if (!ceph_fsid_equal(&m->fsid, &monmap->fsid)) {
+  if (ceph_fsid_compare(&m->fsid, &monmap->fsid)) {
     dout(0) << "handle_scrub fsid " << m->fsid << " != " << monmap->fsid << dendl;
     delete m;
     return;
@@ -1724,7 +1724,7 @@ void OSD::note_up_osd(int osd)
 void OSD::handle_osd_map(MOSDMap *m)
 {
   assert(osd_lock.is_locked());
-  if (!ceph_fsid_equal(&m->fsid, &monmap->fsid)) {
+  if (ceph_fsid_compare(&m->fsid, &monmap->fsid)) {
     dout(0) << "handle_osd_map fsid " << m->fsid << " != " << monmap->fsid << dendl;
     delete m;
     return;
index 1f32bec053d02e118450508a9942ff576f95d7b9..e84a56cc878c1a7a05fd90944e5c2d065b764ff0 100644 (file)
@@ -694,8 +694,8 @@ private:
   // static bits
   static int find_osd_dev(char *result, int whoami);
   static ObjectStore *create_object_store(const char *dev);
-  static int mkfs(const char *dev, ceph_fsid fsid, int whoami);
-  static int peek_super(const char *dev, nstring& magic, ceph_fsid& fsid, int& whoami);
+  static int mkfs(const char *dev, ceph_fsid_t fsid, int whoami);
+  static int peek_super(const char *dev, nstring& magic, ceph_fsid_t& fsid, int& whoami);
 
   // startup/shutdown
   int init();
index 4c02acb3ca9a67499cc5e156fcd1dfab6b296953..eccc76003f68978aee749159b9ae4090ea895909 100644 (file)
@@ -74,7 +74,7 @@ void OSDMap::print_summary(ostream& out)
 }
 
 
-void OSDMap::build_simple(epoch_t e, ceph_fsid &fsid,
+void OSDMap::build_simple(epoch_t e, ceph_fsid_t &fsid,
                          int num_osd, int num_dom, int pg_bits, int lpg_bits,
                          int mds_local_osd)
 {
index eb579f3f3894052d0b4c8684b42a313bb4d15352..fb424c2710021ef0fbeae5b2cf686ea5352e3050 100644 (file)
@@ -132,7 +132,7 @@ class OSDMap {
 public:
   class Incremental {
   public:
-    ceph_fsid fsid;
+    ceph_fsid_t fsid;
     epoch_t epoch;   // new epoch; we are a diff from epoch-1 to epoch
     utime_t ctime;
     int32_t new_flags;
@@ -227,7 +227,7 @@ public:
 
     Incremental(epoch_t e=0) : epoch(e), new_flags(-1), new_max_osd(-1), 
                               new_pg_num(0), new_pgp_num(0), new_lpg_num(0), new_lpgp_num(0) {
-      fsid.major = fsid.minor = 0;
+      memset(&fsid, 0, sizeof(fsid));
     }
     Incremental(bufferlist &bl) {
       bufferlist::iterator p = bl.begin();
@@ -239,7 +239,7 @@ public:
   };
   
 private:
-  ceph_fsid fsid;
+  ceph_fsid_t fsid;
   epoch_t epoch;        // what epoch of the osd cluster descriptor is this
   utime_t ctime, mtime; // epoch start time
 
@@ -294,13 +294,13 @@ private:
             last_pg_change(0),
             flags(0),
             max_osd(0), max_snap(0) { 
-    fsid.major = fsid.minor = 0;
+    memset(&fsid, 0, sizeof(fsid));
     calc_pg_masks();
   }
 
   // map info
-  ceph_fsid& get_fsid() { return fsid; }
-  void set_fsid(ceph_fsid& f) { fsid = f; }
+  ceph_fsid_t& get_fsid() { return fsid; }
+  void set_fsid(ceph_fsid_t& f) { fsid = f; }
 
   epoch_t get_epoch() const { return epoch; }
   void inc_epoch() { epoch++; }
@@ -484,7 +484,7 @@ private:
     if (inc.epoch == 1)
       fsid = inc.fsid;
     else
-      assert(ceph_fsid_equal(&inc.fsid, &fsid));
+      assert(ceph_fsid_compare(&inc.fsid, &fsid) == 0);
     assert(inc.epoch == epoch+1);
     epoch++;
     ctime = inc.ctime;
@@ -899,7 +899,7 @@ private:
   /*
    * handy helpers to build simple maps...
    */
-  void build_simple(epoch_t e, ceph_fsid &fsid,
+  void build_simple(epoch_t e, ceph_fsid_t &fsid,
                    int num_osd, int num_dom,
                    int pg_bits, int lpg_bits,
                    int mds_local_osd);
index 9b6adac5e693c6e50210cf3de385da77337bc7f3..586e9a10ed9843693c8ce593c3be46a7eaac98df 100644 (file)
@@ -614,7 +614,7 @@ struct ObjectMutation {
 class OSDSuperblock {
 public:
   nstring magic;
-  ceph_fsid fsid;
+  ceph_fsid_t fsid;
   int32_t whoami;    // my role in this fs.
   epoch_t current_epoch;             // most recent epoch
   epoch_t oldest_map, newest_map;    // oldest/newest maps we have.
index d97f5fbb7a6bad83005425bd9799044984a84dac..95b618873cd050413415f99ebde72d706fa3c8c7 100644 (file)
@@ -72,7 +72,7 @@ void Objecter::handle_osd_map(MOSDMap *m)
 {
   assert(osdmap); 
 
-  if (!ceph_fsid_equal(&m->fsid, &monmap->fsid)) {
+  if (ceph_fsid_compare(&m->fsid, &monmap->fsid)) {
     dout(0) << "handle_osd_map fsid " << m->fsid << " != " << monmap->fsid << dendl;
     delete m;
     return;