]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
libcephfs.h libcephfs.cc : Defined error codes for the mount function 2704/head
authorBJ Lougee <almightybeeij@gmail.com>
Sat, 11 Oct 2014 07:44:17 +0000 (02:44 -0500)
committerBJ Lougee <almightybeeij@gmail.com>
Sat, 11 Oct 2014 07:44:30 +0000 (02:44 -0500)
Used new error codes from libcephfs.h to replace the magic numbers in the mount functon found in libcephfs.cc.

Signed-off-by: BJ Lougee <almightybeeij@gmail.com>
src/include/cephfs/libcephfs.h
src/libcephfs.cc

index ca386a9f652e52d188f13ceed5d1a21c7d9325cb..f27f879ab2b9a3849335f2ef4c408a2de85b14e4 100644 (file)
@@ -107,6 +107,11 @@ struct CephContext;
 # define CEPH_SETATTR_CTIME 64
 #endif
 
+/* define error codes for the mount function*/
+# define CEPHFS_ERROR_MON_MAP_BUILD 1000
+# define CEPHFS_ERROR_NEW_CLIENT 1002
+# define CEPHFS_ERROR_MESSENGER_START 1003
+
 /**
  * @defgroup libcephfs_h_init Setup and Teardown
  * These are the first and last functions that should be called
index 871dbcfe2e38dba8ce70848b27d44a7fe9019c6c..0fe6a93cbe0985aaf13347c5eb277041941db7ff 100644 (file)
@@ -72,7 +72,7 @@ public:
 
     //monmap
     monclient = new MonClient(cct);
-    ret = -1000;
+    ret = -CEPHFS_ERROR_MON_MAP_BUILD; //defined in libcephfs.h;
     if (monclient->build_initial_monmap() < 0)
       goto fail;
 
@@ -80,12 +80,12 @@ public:
     messenger = Messenger::create(cct, entity_name_t::CLIENT(), "client", msgr_nonce);
 
     //at last the client
-    ret = -1002;
+    ret = -CEPHFS_ERROR_NEW_CLIENT; //defined in libcephfs.h;
     client = new Client(messenger, monclient);
     if (!client)
       goto fail;
 
-    ret = -1003;
+    ret = -CEPHFS_ERROR_MESSENGER_START; //defined in libcephfs.h;
     if (messenger->start() != 0)
       goto fail;