diff options
author | Jiffin Tony Thottan <jthottan@redhat.com> | 2017-10-16 14:24:29 +0530 |
---|---|---|
committer | Amar Tumballi <amarts@gmail.com> | 2019-08-24 02:08:57 +0000 |
commit | 673f2f90f35e5ea381bd22a43403278f89c957a5 (patch) | |
tree | 297f645a4cc6dfbe48609b03da26a1e93607ab7d /cli/src/cli-rpc-ops.c | |
parent | 3fe34c921146a8d11875dc3d904e3a5994eb1cb6 (diff) |
Revert "glusterd: (storhaug) remove ganesha (843e1b0)"
please note as an additional change, macro GLUSTERD_GET_SNAP_DIR
moved from glusterd-store.c to glusterd-snapshot-utils.h
Change-Id: I811efefc148453fe32e4f0d322e80455447cec71
updates: #663
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
Diffstat (limited to 'cli/src/cli-rpc-ops.c')
-rw-r--r-- | cli/src/cli-rpc-ops.c | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c index dcf714bd862..6cd31d200b1 100644 --- a/cli/src/cli-rpc-ops.c +++ b/cli/src/cli-rpc-ops.c @@ -1927,6 +1927,62 @@ out: return ret; } +int +gf_cli_ganesha_cbk(struct rpc_req *req, struct iovec *iov, int count, + void *myframe) +{ + gf_cli_rsp rsp = { + 0, + }; + int ret = -1; + dict_t *dict = NULL; + + GF_ASSERT(myframe); + + if (-1 == req->rpc_status) { + goto out; + } + + ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gf_cli_rsp); + if (ret < 0) { + gf_log(((call_frame_t *)myframe)->this->name, GF_LOG_ERROR, + "Failed to decode xdr response"); + goto out; + } + + gf_log("cli", GF_LOG_DEBUG, "Received resp to ganesha"); + + dict = dict_new(); + + if (!dict) { + ret = -1; + goto out; + } + + ret = dict_unserialize(rsp.dict.dict_val, rsp.dict.dict_len, &dict); + if (ret) + goto out; + + if (rsp.op_ret) { + if (strcmp(rsp.op_errstr, "")) + cli_err("nfs-ganesha: failed: %s", rsp.op_errstr); + else + cli_err("nfs-ganesha: failed"); + } + + else { + cli_out("nfs-ganesha : success "); + } + + ret = rsp.op_ret; + +out: + if (dict) + dict_unref(dict); + cli_cmd_broadcast_response(ret); + return ret; +} + char * is_server_debug_xlator(void *myframe) { @@ -4200,6 +4256,31 @@ out: } int32_t +gf_cli_ganesha(call_frame_t *frame, xlator_t *this, void *data) +{ + gf_cli_req req = {{ + 0, + }}; + int ret = 0; + dict_t *dict = NULL; + + if (!frame || !this || !data) { + ret = -1; + goto out; + } + + dict = data; + + ret = cli_to_glusterd(&req, frame, gf_cli_ganesha_cbk, + (xdrproc_t)xdr_gf_cli_req, dict, GLUSTER_CLI_GANESHA, + this, cli_rpc_prog, NULL); +out: + gf_log("cli", GF_LOG_DEBUG, "Returning %d", ret); + + return ret; +} + +int32_t gf_cli_set_volume(call_frame_t *frame, xlator_t *this, void *data) { gf_cli_req req = {{ @@ -11345,6 +11426,7 @@ struct rpc_clnt_procedure gluster_cli_actors[GLUSTER_CLI_MAXVALUE] = { [GLUSTER_CLI_BITROT] = {"BITROT", gf_cli_bitrot}, [GLUSTER_CLI_GET_STATE] = {"GET_STATE", gf_cli_get_state}, [GLUSTER_CLI_RESET_BRICK] = {"RESET_BRICK", gf_cli_reset_brick}, + [GLUSTER_CLI_GANESHA] = {"GANESHA", gf_cli_ganesha}, }; struct rpc_clnt_program cli_prog = { |