summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/fd.c
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 /libglusterfs/src/fd.c
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 'libglusterfs/src/fd.c')
-rw-r--r--libglusterfs/src/fd.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/libglusterfs/src/fd.c b/libglusterfs/src/fd.c
index 65b23ed3503..01e292cc107 100644
--- a/libglusterfs/src/fd.c
+++ b/libglusterfs/src/fd.c
@@ -1164,19 +1164,16 @@ fdentry_dump_to_dict (fdentry_t *fdentry, char *prefix, dict_t *dict,
return;
if (fdentry->fd) {
- memset (key, 0, sizeof (key));
snprintf (key, sizeof (key), "%s.pid", prefix);
ret = dict_set_uint64 (dict, key, fdentry->fd->pid);
if (ret)
return;
- memset (key, 0, sizeof (key));
snprintf (key, sizeof (key), "%s.refcount", prefix);
ret = dict_set_int32 (dict, key, GF_ATOMIC_GET (fdentry->fd->refcount));
if (ret)
return;
- memset (key, 0, sizeof (key));
snprintf (key, sizeof (key), "%s.flags", prefix);
ret = dict_set_int32 (dict, key, fdentry->fd->flags);
@@ -1202,19 +1199,16 @@ fdtable_dump_to_dict (fdtable_t *fdtable, char *prefix, dict_t *dict)
if (ret)
return;
- memset (key, 0, sizeof (key));
snprintf (key, sizeof (key), "%s.fdtable.refcount", prefix);
ret = dict_set_int32 (dict, key, fdtable->refcount);
if (ret)
goto out;
- memset (key, 0, sizeof (key));
snprintf (key, sizeof (key), "%s.fdtable.maxfds", prefix);
ret = dict_set_uint32 (dict, key, fdtable->max_fds);
if (ret)
goto out;
- memset (key, 0, sizeof (key));
snprintf (key, sizeof (key), "%s.fdtable.firstfree", prefix);
ret = dict_set_int32 (dict, key, fdtable->first_free);
if (ret)
@@ -1223,7 +1217,6 @@ fdtable_dump_to_dict (fdtable_t *fdtable, char *prefix, dict_t *dict)
for (i = 0; i < fdtable->max_fds; i++) {
if (GF_FDENTRY_ALLOCATED ==
fdtable->fdentries[i].next_free) {
- memset (key, 0, sizeof (key));
snprintf (key, sizeof (key), "%s.fdtable.fdentry%d",
prefix, i);
fdentry_dump_to_dict (&fdtable->fdentries[i], key,
@@ -1231,7 +1224,6 @@ fdtable_dump_to_dict (fdtable_t *fdtable, char *prefix, dict_t *dict)
}
}
- memset (key, 0, sizeof (key));
snprintf (key, sizeof (key), "%s.fdtable.openfds", prefix);
ret = dict_set_int32 (dict, key, openfds);