diff options
author | Niels de Vos <ndevos@redhat.com> | 2011-11-12 17:58:44 -0500 |
---|---|---|
committer | Vijay Bellur <vijay@gluster.com> | 2011-11-23 04:06:29 -0800 |
commit | 89a6dc3c2b31299ac10de449d318ecf341e8b840 (patch) | |
tree | 1900a5ae81144e619567c80a9db4a1c472dac333 | |
parent | 829f2b90fba8f66287e2e3b89aed9c971c2d828b (diff) |
cli-cmd: call cli_cmd_unlock in the same function as cli_cmd_lock
cli_cmd_submit calls cli_cmd_lock, but cli_cmd_unlock is done in
cli_cmd_await_response. It is clearer to do the locking and unlocking in
the same function.
Only cli_cmd_submit seems to call cli_cmd_await_response, therefore
moving the cli_cmd_unlock to cli_cmd_submit should be safe.
Change-Id: I015ae0e2a404005c43606ef5258e3cfad41a88d4
BUG: 3821
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-on: http://review.gluster.com/721
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amar@gluster.com>
-rw-r--r-- | cli/src/cli-cmd.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/cli/src/cli-cmd.c b/cli/src/cli-cmd.c index 17869eb6..a7adfa98 100644 --- a/cli/src/cli-cmd.c +++ b/cli/src/cli-cmd.c @@ -297,8 +297,6 @@ cli_cmd_await_response (unsigned time) cmd_done = 0; - cli_cmd_unlock (); - if (ret) return ret; @@ -381,8 +379,9 @@ cli_cmd_submit (void *req, call_frame_t *frame, if (!ret) { cmd_sent = 1; ret = cli_cmd_await_response (timeout); - } else - cli_cmd_unlock (); + } + + cli_cmd_unlock (); gf_log ("cli", GF_LOG_DEBUG, "Returning %d", ret); return ret; |