Skip to content

Commit

Permalink
embedded: add MDS to libcephd
Browse files Browse the repository at this point in the history
Added MDS to libcephd

Signed-off-by: Bassam Tabbara <[email protected]>
  • Loading branch information
bassam committed Jan 11, 2017
1 parent 3aca476 commit 3721790
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/ceph_mds.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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);
Expand Down
9 changes: 9 additions & 0 deletions src/include/cephd/libcephd.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 3 additions & 1 deletion src/libcephd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -21,6 +22,7 @@ set(merge_libs
global
json_spirit
kv
mds
mon
os
osd
Expand Down
6 changes: 6 additions & 0 deletions src/libcephd/libcephd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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);
}

0 comments on commit 3721790

Please sign in to comment.