From 58974b02b6ebb65ee1f7baf23b0fe6c3e7fcf8cd Mon Sep 17 00:00:00 2001 From: shishir gowda Date: Thu, 31 Mar 2011 04:56:10 +0000 Subject: TOP: handle list-cnt behaviour uniformly. Valid range is 0-100. if list-cnt is 0 or there are no files in the list, handle it uniformly. Signed-off-by: shishir gowda Signed-off-by: Vijay Bellur BUG: 2622 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2622 --- xlators/debug/io-stats/src/io-stats.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'xlators') diff --git a/xlators/debug/io-stats/src/io-stats.c b/xlators/debug/io-stats/src/io-stats.c index 863f77a2a..d4dd786ab 100644 --- a/xlators/debug/io-stats/src/io-stats.c +++ b/xlators/debug/io-stats/src/io-stats.c @@ -1039,6 +1039,8 @@ io_stats_dump_stats_to_dict (xlator_t *this, dict_t *resp, goto out; } ret = dict_set_int32 (resp, "top-op", flags); + if (!list_cnt) + goto out; LOCK (&list_head->lock); { list_for_each_entry (entry, &list_head->iosstats->list, list) { @@ -2600,8 +2602,6 @@ notify (xlator_t *this, int32_t event, void *data, ...) ret = dict_get_int32 (dict, "top-op", &top_op); if (!ret) { ret = dict_get_int32 (dict, "list-cnt", &list_cnt); - if (!list_cnt) - list_cnt = 100; if (top_op > IOS_STATS_TYPE_NONE && top_op < IOS_STATS_TYPE_MAX) ret = io_stats_dump_stats_to_dict (this, output, -- cgit