]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
make cmonctl and cfuse use MonClient too
authorSage Weil <sage@newdream.net>
Mon, 10 Mar 2008 15:54:57 +0000 (08:54 -0700)
committerSage Weil <sage@newdream.net>
Mon, 10 Mar 2008 15:54:57 +0000 (08:54 -0700)
src/cfuse.cc
src/cmonctl.cc

index fed50ca001134118f8c10b1b52e6c834c6b31730..bcd6194d7d25e09c274553bd7f2bb4f1e01be3f7 100644 (file)
@@ -25,6 +25,8 @@ using namespace std;
 
 #include "msg/SimpleMessenger.h"
 
+#include "mon/MonClient.h"
+
 #include "common/Timer.h"
        
 #ifndef DARWIN
@@ -50,10 +52,11 @@ int main(int argc, const char **argv, const char *envp[]) {
 
   if (g_conf.clock_tare) g_clock.tare();
 
-  // load monmap
+  // get monmap
   MonMap monmap;
-  int r = monmap.read(".ceph_monmap");
-  assert(r >= 0);
+  MonClient mc;
+  if (mc.get_monmap(&monmap) < 0)
+    return -1;
 
   // start up network
   rank.bind();
index 2f4ecc554f8015a7eababac30fb82d485acb0f92..42d225b4b696cf2a1b12a363250bf2df3b1b1f6c 100644 (file)
@@ -20,6 +20,7 @@ using namespace std;
 #include "config.h"
 
 #include "mon/MonMap.h"
+#include "mon/MonClient.h"
 #include "msg/SimpleMessenger.h"
 #include "messages/MMonCommand.h"
 #include "messages/MMonCommandAck.h"
@@ -98,10 +99,11 @@ int main(int argc, const char **argv, const char *envp[]) {
       nargs.push_back(args[i]);
   }
 
-  // load monmap
+  // get monmap
   MonMap monmap;
-  int r = monmap.read(".ceph_monmap");
-  assert(r >= 0);
+  MonClient mc;
+  if (mc.get_monmap(&monmap) < 0)
+    return -1;
   
   // start up network
   rank.bind();