From 89a6dc3c2b31299ac10de449d318ecf341e8b840 Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Sat, 12 Nov 2011 17:58:44 -0500 Subject: 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 Reviewed-on: http://review.gluster.com/721 Tested-by: Gluster Build System Reviewed-by: Amar Tumballi --- cli/src/cli-cmd.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'cli') diff --git a/cli/src/cli-cmd.c b/cli/src/cli-cmd.c index 17869eb61..a7adfa981 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; -- cgit