]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
embedded: add MDS to libcephd
authorBassam Tabbara <bassam.tabbara@quantum.com>
Fri, 18 Nov 2016 22:40:30 +0000 (14:40 -0800)
committerBassam Tabbara <bassam.tabbara@quantum.com>
Wed, 11 Jan 2017 21:59:17 +0000 (13:59 -0800)
Added MDS to libcephd

Signed-off-by: Bassam Tabbara <bassam.tabbara@quantum.com>
src/ceph_mds.cc
src/include/cephd/libcephd.h
src/libcephd/CMakeLists.txt
src/libcephd/libcephd.cc

index a444d573975ab4ff5a59a7bd9d6ad3cf31f424ce..4cd951918ad205bf0fbfbe0bc0b6c1f4a5136fd6 100644 (file)
@@ -49,7 +49,7 @@ using namespace std;
 #define dout_context g_ceph_context
 #define dout_subsys ceph_subsys_mds
 
-void usage()
+static void usage()
 {
   cout << "usage: ceph-mds -i name [flags] [[--hot-standby][rank]]\n"
        << "  -m monitorip:port\n"
@@ -86,7 +86,11 @@ static void handle_mds_signal(int signum)
     mds->handle_signal(signum);
 }
 
-int main(int argc, const char **argv) 
+#ifdef BUILDING_FOR_EMBEDDED
+extern "C" int cephd_mds(int argc, const char **argv)
+#else
+int main(int argc, const char **argv)
+#endif
 {
   vector<const char*> args;
   argv_to_vec(argc, argv, args);
index d8f90c6ddd3d71509a0c573e40b40d9722106e43..5538c058ad15d81576f9f295fe74c63e3e6c594a 100644 (file)
@@ -76,6 +76,15 @@ CEPH_LIBCEPHD_API int cephd_run_mon(int argc, const char **argv);
  */
 CEPH_LIBCEPHD_API int cephd_run_osd(int argc, const char **argv);
 
+/**
+ * Runs ceph-mds passing in command line args
+ *
+ * @param argc number of parameters
+ * @param argv array of string arguments
+ * @returns 0 on success, negative error code on failure
+ */
+CEPH_LIBCEPHD_API int cephd_run_mds(int argc, const char **argv);
+
 #ifdef __cplusplus
 }
 #endif
index b5e398f0fb93e8896d7f172ef1c524f74872cc45..0eb06371f2a0f0677b2a167612b9c6475bcfe9f6 100644 (file)
@@ -3,7 +3,8 @@ include(MergeStaticLibraries)
 add_library(cephd_base STATIC
   libcephd.cc
   ../ceph_mon.cc
-  ../ceph_osd.cc)
+  ../ceph_osd.cc
+  ../ceph_mds.cc)
 
 set_target_properties(cephd_base PROPERTIES COMPILE_DEFINITIONS BUILDING_FOR_EMBEDDED)
 
@@ -21,6 +22,7 @@ set(merge_libs
   global
   json_spirit
   kv
+  mds
   mon
   os
   osd
index 6adf4d3fa8e6e76918dc24ebe0920d60baa838e0..1139b5eb5db13f3cdf00dbf5f2fc7a3e2764b9d9 100644 (file)
@@ -223,6 +223,7 @@ void cephd_preload_rados_classes(OSD *osd)
 
 extern "C" int cephd_mon(int argc, const char **argv);
 extern "C" int cephd_osd(int argc, const char **argv);
+extern "C" int cephd_mds(int argc, const char **argv);
 
 int cephd_run_mon(int argc, const char **argv)
 {
@@ -233,3 +234,8 @@ int cephd_run_osd(int argc, const char **argv)
 {
     return cephd_osd(argc, argv);
 }
+
+int cephd_run_mds(int argc, const char **argv)
+{
+    return cephd_mds(argc, argv);
+}