summaryrefslogtreecommitdiffstats
path: root/xlators/debug
diff options
context:
space:
mode:
authorshishir gowda <shishirng@gluster.com>2011-03-31 04:56:10 +0000
committerVijay Bellur <vijay@dev.gluster.com>2011-03-31 05:04:36 -0700
commit58974b02b6ebb65ee1f7baf23b0fe6c3e7fcf8cd (patch)
tree20cfa527ff37e8a6b2a17aa871e2f0bdca939db2 /xlators/debug
parent3b5195cfa4976e1d83646b70b0f08f583a7a1094 (diff)
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 <shishirng@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 2622 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2622
Diffstat (limited to 'xlators/debug')
-rw-r--r--xlators/debug/io-stats/src/io-stats.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/xlators/debug/io-stats/src/io-stats.c b/xlators/debug/io-stats/src/io-stats.c
index 863f77a2ae1..d4dd786ab78 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,