From 3721790fcfed6636d0956e401264f6482277c376 Mon Sep 17 00:00:00 2001 From: Bassam Tabbara Date: Fri, 18 Nov 2016 14:40:30 -0800 Subject: [PATCH] embedded: add MDS to libcephd Added MDS to libcephd Signed-off-by: Bassam Tabbara --- src/ceph_mds.cc | 8 ++++++-- src/include/cephd/libcephd.h | 9 +++++++++ src/libcephd/CMakeLists.txt | 4 +++- src/libcephd/libcephd.cc | 6 ++++++ 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/src/ceph_mds.cc b/src/ceph_mds.cc index a444d573975..4cd951918ad 100644 --- a/src/ceph_mds.cc +++ b/src/ceph_mds.cc @@ -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 args; argv_to_vec(argc, argv, args); diff --git a/src/include/cephd/libcephd.h b/src/include/cephd/libcephd.h index d8f90c6ddd3..5538c058ad1 100644 --- a/src/include/cephd/libcephd.h +++ b/src/include/cephd/libcephd.h @@ -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 diff --git a/src/libcephd/CMakeLists.txt b/src/libcephd/CMakeLists.txt index b5e398f0fb9..0eb06371f2a 100644 --- a/src/libcephd/CMakeLists.txt +++ b/src/libcephd/CMakeLists.txt @@ -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 diff --git a/src/libcephd/libcephd.cc b/src/libcephd/libcephd.cc index 6adf4d3fa8e..1139b5eb5db 100644 --- a/src/libcephd/libcephd.cc +++ b/src/libcephd/libcephd.cc @@ -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); +} -- 2.47.3