From e311a30f845255b44f3abc56215f584a3c245136 Mon Sep 17 00:00:00 2001 From: Kaushal M Date: Fri, 17 Feb 2012 12:32:18 +0530 Subject: cli, glusterfsd: Fixes for "volume top {read,write}-perf" Changed variables to use unsigned types, to support larger comninations of block_size * block_count Also increases cli time out for "volume top" ops to 600, to allow more time for glusterd to return the results to cli. Change-Id: I4b953799c78a5a184311f6f8c4a7a99dc9e87a07 BUG: 783980 Signed-off-by: Kaushal M Reviewed-on: http://review.gluster.com/2761 Tested-by: Gluster Build System Reviewed-by: Amar Tumballi Reviewed-by: Vijay Bellur --- cli/src/cli-cmd-parser.c | 12 ++++++------ cli/src/cli.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'cli') diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c index 00c2f3618..24310cac5 100644 --- a/cli/src/cli-cmd-parser.c +++ b/cli/src/cli-cmd-parser.c @@ -1692,8 +1692,8 @@ cli_cmd_volume_top_parse (const char **words, int wordcount, int32_t list_cnt = -1; int index = 0; int perf = 0; - int32_t blk_size = 0; - int32_t count = 0; + uint32_t blk_size = 0; + uint32_t count = 0; char *delimiter = NULL; char *opwords[] = { "open", "read", "write", "opendir", "readdir", "read-perf", "write-perf", @@ -1759,7 +1759,7 @@ cli_cmd_volume_top_parse (const char **words, int wordcount, } if (!strcmp (key, "brick")) { delimiter = strchr (value, ':'); - if (!delimiter || delimiter == value + if (!delimiter || delimiter == value || *(delimiter+1) != '/') { cli_out ("wrong brick type: %s, use :" "", value); @@ -1794,7 +1794,7 @@ cli_cmd_volume_top_parse (const char **words, int wordcount, ret = -1; goto out; } - ret = dict_set_int32 (dict, "blk-size", blk_size); + ret = dict_set_uint32 (dict, "blk-size", blk_size); } else if (perf && !strcmp (key, "count")) { ret = gf_is_str_int (value); if (!ret) @@ -1802,14 +1802,14 @@ cli_cmd_volume_top_parse (const char **words, int wordcount, if (ret || (count <= 0)) { if (count < 0) cli_out ("count is an invalid number"); - else + else cli_out ("count should be an integer " "greater than zero"); ret = -1; goto out; } - ret = dict_set_int32 (dict, "blk-cnt", count); + ret = dict_set_uint32 (dict, "blk-cnt", count); } else { ret = -1; goto out; diff --git a/cli/src/cli.h b/cli/src/cli.h index 1f78da1fb..8080e42d6 100644 --- a/cli/src/cli.h +++ b/cli/src/cli.h @@ -33,7 +33,7 @@ #define CLI_GLUSTERD_PORT 24007 #define CLI_DEFAULT_CONN_TIMEOUT 120 #define CLI_DEFAULT_CMD_TIMEOUT 120 -#define CLI_TOP_CMD_TIMEOUT 300 //Longer timeout for volume top +#define CLI_TOP_CMD_TIMEOUT 600 //Longer timeout for volume top #define DEFAULT_CLI_LOG_FILE_DIRECTORY DATADIR "/log/glusterfs" #define CLI_VOL_STATUS_BRICK_LEN 55 #define CLI_TAB_LENGTH 8 -- cgit