summaryrefslogtreecommitdiffstats
path: root/xlators/debug
diff options
context:
space:
mode:
authorYaniv Kaul <ykaul@redhat.com>2018-08-02 16:02:33 +0300
committerAmar Tumballi <amarts@redhat.com>2018-08-14 05:15:04 +0000
commitb2b6ab8eff317f6a507ab23897ea6cd5c718d99a (patch)
tree45fb1392f535f0236f057d9d9c932feda4f9ab40 /xlators/debug
parent32c8f70f49c0e287c53998e37867f00fa775377b (diff)
All: remove memset() before sprintf()
It's not needed. There's a good chance the compiler is smart enough to remove it anyway, but it can't hurt - I hope. Compile-tested only! Change-Id: Id7c054e146ba630227affa591007803f3046416b updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
Diffstat (limited to 'xlators/debug')
-rw-r--r--xlators/debug/io-stats/src/io-stats.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/xlators/debug/io-stats/src/io-stats.c b/xlators/debug/io-stats/src/io-stats.c
index 7eaffa00c78..7a7a9217df0 100644
--- a/xlators/debug/io-stats/src/io-stats.c
+++ b/xlators/debug/io-stats/src/io-stats.c
@@ -1301,10 +1301,6 @@ io_stats_dump_global_to_logfp (xlator_t *this, struct ios_global_stats *stats,
ios_log (this, logfp, "%s", str_read);
ios_log (this, logfp, "%s\n", str_write);
- memset (str_header, 0, sizeof (str_header));
- memset (str_read, 0, sizeof (str_read));
- memset (str_write, 0, sizeof (str_write));
-
snprintf (str_header, sizeof (str_header), "%-12s %c",
"Block Size", ':');
snprintf (str_read, sizeof (str_read), "%-12s %c",
@@ -1437,7 +1433,6 @@ io_stats_dump_global_to_dict (xlator_t *this, struct ios_global_stats *stats,
gf_log (this->name, GF_LOG_ERROR, "failed to set "
"interval %d", interval);
- memset (key, 0, sizeof (key));
snprintf (key, sizeof (key), "%d-duration", interval);
sec = (uint64_t) (now->tv_sec - stats->started_at.tv_sec);
ret = dict_set_uint64 (dict, key, sec);
@@ -1447,7 +1442,6 @@ io_stats_dump_global_to_dict (xlator_t *this, struct ios_global_stats *stats,
goto out;
}
- memset (key, 0, sizeof (key));
snprintf (key, sizeof (key), "%d-total-read", interval);
ret = dict_set_uint64 (dict, key, GF_ATOMIC_GET (stats->data_read));
if (ret) {
@@ -1457,7 +1451,6 @@ io_stats_dump_global_to_dict (xlator_t *this, struct ios_global_stats *stats,
goto out;
}
- memset (key, 0, sizeof (key));
snprintf (key, sizeof (key), "%d-total-write", interval);
ret = dict_set_uint64 (dict, key, GF_ATOMIC_GET (stats->data_written));
if (ret) {
@@ -1469,7 +1462,6 @@ io_stats_dump_global_to_dict (xlator_t *this, struct ios_global_stats *stats,
for (i = 0; i < 32; i++) {
count = GF_ATOMIC_GET (stats->block_count_read[i]);
if (count) {
- memset (key, 0, sizeof (key));
snprintf (key, sizeof (key), "%d-read-%d", interval,
(1 << i));
ret = dict_set_uint64 (dict, key, count);