From 184fba37889b87c27af90adf357b38fa95f1e78d Mon Sep 17 00:00:00 2001 From: Csaba Henk Date: Mon, 18 Apr 2011 17:25:25 +0000 Subject: cli: implement "system:: getwd" command Signed-off-by: Csaba Henk Signed-off-by: Anand Avati BUG: 2785 (gsyncd logs on slave side go to /dev/null) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2785 --- xlators/mgmt/glusterd/src/glusterd-handler.c | 27 +++++++++++++++++++++++++++ xlators/mgmt/glusterd/src/glusterd.h | 3 +++ 2 files changed, 30 insertions(+) (limited to 'xlators/mgmt') diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c index 42909136a..a78c876e3 100644 --- a/xlators/mgmt/glusterd/src/glusterd-handler.c +++ b/xlators/mgmt/glusterd/src/glusterd-handler.c @@ -3201,6 +3201,32 @@ out: return ret; } +int +glusterd_handle_getwd (rpcsvc_request_t *req) +{ + int32_t ret = -1; + gf1_cli_getwd_rsp rsp = {0,}; + glusterd_conf_t *priv = NULL; + + GF_ASSERT (req); + + priv = THIS->private; + GF_ASSERT (priv); + + gf_log ("glusterd", GF_LOG_INFO, "Received getwd req"); + + rsp.wd = priv->workdir; + + ret = glusterd_submit_reply (req, &rsp, NULL, 0, NULL, + gf_xdr_from_cli_getwd_rsp); + + glusterd_friend_sm (); + glusterd_op_sm (); + + return ret; +} + + int glusterd_friend_remove (uuid_t uuid, char *hostname) { @@ -3899,6 +3925,7 @@ rpcsvc_actor_t gd_svc_cli_actors[] = { [GLUSTER_CLI_GSYNC_SET] = { "GSYNC_SET", GLUSTER_CLI_GSYNC_SET, glusterd_handle_gsync_set, NULL, NULL}, [GLUSTER_CLI_PROFILE_VOLUME] = { "STATS_VOLUME", GLUSTER_CLI_PROFILE_VOLUME, glusterd_handle_cli_profile_volume, NULL, NULL}, [GLUSTER_CLI_QUOTA] = { "QUOTA", GLUSTER_CLI_QUOTA, glusterd_handle_quota, NULL, NULL}, + [GLUSTER_CLI_GETWD] = { "GETWD", GLUSTER_CLI_GETWD, glusterd_handle_getwd, NULL, NULL}, }; diff --git a/xlators/mgmt/glusterd/src/glusterd.h b/xlators/mgmt/glusterd/src/glusterd.h index 9175983c7..2fcd11c11 100644 --- a/xlators/mgmt/glusterd/src/glusterd.h +++ b/xlators/mgmt/glusterd/src/glusterd.h @@ -495,6 +495,9 @@ glusterd_validate_reconfopts (glusterd_volinfo_t *volinfo, dict_t *val_dict, cha int glusterd_handle_cli_profile_volume (rpcsvc_request_t *req); +int +glusterd_handle_getwd (rpcsvc_request_t *req); + int32_t glusterd_set_volume (rpcsvc_request_t *req, dict_t *dict); int -- cgit