diff options
Diffstat (limited to 'cli')
-rw-r--r-- | cli/src/cli-cmd-global.c | 54 | ||||
-rw-r--r-- | cli/src/cli-cmd-parser.c | 106 | ||||
-rw-r--r-- | cli/src/cli-cmd.c | 3 | ||||
-rw-r--r-- | cli/src/cli-rpc-ops.c | 79 | ||||
-rw-r--r-- | cli/src/cli.h | 3 |
5 files changed, 1 insertions, 244 deletions
diff --git a/cli/src/cli-cmd-global.c b/cli/src/cli-cmd-global.c index f4544da367c..2f9d24501d4 100644 --- a/cli/src/cli-cmd-global.c +++ b/cli/src/cli-cmd-global.c @@ -32,8 +32,6 @@ extern rpc_clnt_prog_t *cli_rpc_prog; int cli_cmd_global_help_cbk (struct cli_state *state, struct cli_cmd_word *in_word, const char **words, int wordcount); -int cli_cmd_ganesha_cbk (struct cli_state *state, struct cli_cmd_word *word, - const char **words, int wordcount); int cli_cmd_get_state_cbk (struct cli_state *state, struct cli_cmd_word *word, const char **words, int wordcount); @@ -43,10 +41,6 @@ struct cli_cmd global_cmds[] = { cli_cmd_global_help_cbk, "list global commands", }, - { "nfs-ganesha {enable| disable} ", - cli_cmd_ganesha_cbk, - "Enable/disable NFS-Ganesha support", - }, { "get-state [<daemon>] [odir </path/to/output/dir/>] [file <filename>]", cli_cmd_get_state_cbk, "Get local state representation of mentioned daemon", @@ -91,54 +85,6 @@ out: } -int cli_cmd_ganesha_cbk (struct cli_state *state, struct cli_cmd_word *word, - const char **words, int wordcount) - -{ - int sent = 0; - int parse_error = 0; - int ret = -1; - rpc_clnt_procedure_t *proc = NULL; - call_frame_t *frame = NULL; - dict_t *options = NULL; - cli_local_t *local = NULL; - char *op_errstr = NULL; - - proc = &cli_rpc_prog->proctable[GLUSTER_CLI_GANESHA]; - - frame = create_frame (THIS, THIS->ctx->pool); - if (!frame) - goto out; - - ret = cli_cmd_ganesha_parse (state, words, wordcount, - &options, &op_errstr); - if (ret) { - if (op_errstr) { - cli_err ("%s", op_errstr); - GF_FREE (op_errstr); - } else - cli_usage_out (word->pattern); - parse_error = 1; - goto out; - } - - CLI_LOCAL_INIT (local, words, frame, options); - - if (proc->fn) { - ret = proc->fn (frame, THIS, options); - } - -out: - if (ret) { - cli_cmd_sent_status_get (&sent); - if ((sent == 0) && (parse_error == 0)) - cli_out ("Setting global option failed"); - } - - CLI_STACK_DESTROY (frame); - return ret; -} - int cli_cmd_get_state_cbk (struct cli_state *state, struct cli_cmd_word *word, const char **words, int wordcount) diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c index e50d9f66f91..be53cd2ed40 100644 --- a/cli/src/cli-cmd-parser.c +++ b/cli/src/cli-cmd-parser.c @@ -818,112 +818,6 @@ out: return ret; } -/* Parsing global option for NFS-Ganesha config - * gluster nfs-ganesha enable/disable */ - -int32_t -cli_cmd_ganesha_parse (struct cli_state *state, - const char **words, int wordcount, - dict_t **options, char **op_errstr) -{ - dict_t *dict = NULL; - int ret = -1; - char *key = NULL; - char *value = NULL; - char *w = NULL; - char *opwords[] = { "enable", "disable", NULL }; - const char *question = NULL; - gf_answer_t answer = GF_ANSWER_NO; - - - GF_ASSERT (words); - GF_ASSERT (options); - - dict = dict_new (); - - if (!dict) - goto out; - - if (wordcount != 2) - goto out; - - key = (char *) words[0]; - value = (char *) words[1]; - - if (!key || !value) { - cli_out ("Usage : nfs-ganesha <enable/disable>"); - ret = -1; - goto out; - } - - ret = gf_strip_whitespace (value, strlen (value)); - if (ret == -1) - goto out; - - if (strcmp (key, "nfs-ganesha")) { - gf_asprintf (op_errstr, "Global option: error: ' %s '" - "is not a valid global option.", key); - ret = -1; - goto out; - } - - w = str_getunamb (value, opwords); - if (!w) { - cli_out ("Invalid global option \n" - "Usage : nfs-ganesha <enable/disable>"); - ret = -1; - goto out; - } - - question = "Enabling NFS-Ganesha requires Gluster-NFS to be" - " disabled across the trusted pool. Do you " - "still want to continue?\n"; - - if (strcmp (value, "enable") == 0) { - answer = cli_cmd_get_confirmation (state, question); - if (GF_ANSWER_NO == answer) { - gf_log ("cli", GF_LOG_ERROR, "Global operation " - "cancelled, exiting"); - ret = -1; - goto out; - } - } - cli_out ("This will take a few minutes to complete. Please wait .."); - - ret = dict_set_str (dict, "key", key); - if (ret) { - gf_log (THIS->name, GF_LOG_ERROR, "dict set on key failed"); - goto out; - } - - ret = dict_set_str (dict, "value", value); - if (ret) { - gf_log (THIS->name, GF_LOG_ERROR, "dict set on value failed"); - goto out; - } - - ret = dict_set_str (dict, "globalname", "All"); - if (ret) { - gf_log (THIS->name, GF_LOG_ERROR, "dict set on global" - " key failed."); - goto out; - } - - ret = dict_set_int32 (dict, "hold_global_locks", _gf_true); - if (ret) { - gf_log (THIS->name, GF_LOG_ERROR, "dict set on global key " - "failed."); - goto out; - } - - *options = dict; -out: - if (ret) - dict_unref (dict); - - return ret; -} - int32_t cli_cmd_get_state_parse (struct cli_state *state, const char **words, int wordcount, diff --git a/cli/src/cli-cmd.c b/cli/src/cli-cmd.c index 8a750414108..236009b449e 100644 --- a/cli/src/cli-cmd.c +++ b/cli/src/cli-cmd.c @@ -369,8 +369,7 @@ cli_cmd_submit (struct rpc_clnt* rpc, void *req, call_frame_t *frame, unsigned timeout = 0; if ((GLUSTER_CLI_PROFILE_VOLUME == procnum) || - (GLUSTER_CLI_HEAL_VOLUME == procnum) || - (GLUSTER_CLI_GANESHA == procnum)) + (GLUSTER_CLI_HEAL_VOLUME == procnum)) timeout = cli_ten_minutes_timeout; else timeout = cli_default_conn_timeout; diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c index 879c6c40aa1..afa0487e2f5 100644 --- a/cli/src/cli-rpc-ops.c +++ b/cli/src/cli-rpc-ops.c @@ -2200,60 +2200,6 @@ 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) { @@ -4782,30 +4728,6 @@ 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) { @@ -11974,7 +11896,6 @@ struct rpc_clnt_procedure gluster_cli_actors[GLUSTER_CLI_MAXVALUE] = { [GLUSTER_CLI_SYS_EXEC] = {"SYS_EXEC", gf_cli_sys_exec}, [GLUSTER_CLI_SNAP] = {"SNAP", gf_cli_snapshot}, [GLUSTER_CLI_BARRIER_VOLUME] = {"BARRIER VOLUME", gf_cli_barrier_volume}, - [GLUSTER_CLI_GANESHA] = {"GANESHA", gf_cli_ganesha}, [GLUSTER_CLI_GET_VOL_OPT] = {"GET_VOL_OPT", gf_cli_get_vol_opt}, [GLUSTER_CLI_BITROT] = {"BITROT", gf_cli_bitrot}, [GLUSTER_CLI_ATTACH_TIER] = {"ATTACH_TIER", gf_cli_attach_tier}, diff --git a/cli/src/cli.h b/cli/src/cli.h index 27a3f3cc136..7b63e7d2804 100644 --- a/cli/src/cli.h +++ b/cli/src/cli.h @@ -253,9 +253,6 @@ cli_cmd_bitrot_parse (const char **words, int wordcount, dict_t **opt); int32_t cli_cmd_volume_set_parse (struct cli_state *state, const char **words, int wordcount, dict_t **options, char **op_errstr); -int32_t -cli_cmd_ganesha_parse (struct cli_state *state, const char **words, - int wordcount, dict_t **options, char **op_errstr); int32_t cli_cmd_get_state_parse (struct cli_state *state, const char **words, |