summaryrefslogtreecommitdiffstats
path: root/glusterfsd
diff options
context:
space:
mode:
authorYaniv Kaul <ykaul@redhat.com>2018-08-21 19:18:17 +0300
committerAmar Tumballi <amarts@redhat.com>2018-08-29 06:09:10 +0000
commit8d171374cbbbdd88c8714198903b317bd132e1e2 (patch)
treeb10e6fd5ba8b79d41e79c2d22757a5d3e82576a4 /glusterfsd
parent60ef38482cc8d61711ecc48159cf6c036b1522a8 (diff)
multiple files: move from strlen() to sizeof()
{glusterfsd|glusterfsd-mgmt|quota-common-utils|xlator|tier|stripe}.c tools/setgfid2path/src/main.c xlators/cluster/afr/src/afr-inode-read.c {glusterfs-acl|glusterfs}.h For const strings, just do compile time size calc instead of runtime. Compile-tested only! Change-Id: I303684b1ff29b05c10126fb1057f507e404ced07 updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
Diffstat (limited to 'glusterfsd')
-rw-r--r--glusterfsd/src/glusterfsd-mgmt.c4
-rw-r--r--glusterfsd/src/glusterfsd.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/glusterfsd/src/glusterfsd-mgmt.c b/glusterfsd/src/glusterfsd-mgmt.c
index 3228c27c6aa..8b25f3a1525 100644
--- a/glusterfsd/src/glusterfsd-mgmt.c
+++ b/glusterfsd/src/glusterfsd-mgmt.c
@@ -826,10 +826,10 @@ glusterfs_handle_bitrot (rpcsvc_request_t *req)
goto out;
}
- if (!strncmp (scrub_opt, "status", strlen ("status"))) {
+ if (!strncmp (scrub_opt, "status", SLEN ("status"))) {
ret = xlator->notify (xlator, GF_EVENT_SCRUB_STATUS, input,
output);
- } else if (!strncmp (scrub_opt, "ondemand", strlen ("ondemand"))) {
+ } else if (!strncmp (scrub_opt, "ondemand", SLEN ("ondemand"))) {
ret = xlator->notify (xlator, GF_EVENT_SCRUB_ONDEMAND, input,
output);
if (ret == -2) {
diff --git a/glusterfsd/src/glusterfsd.c b/glusterfsd/src/glusterfsd.c
index 5497f592ea6..81a73344d6b 100644
--- a/glusterfsd/src/glusterfsd.c
+++ b/glusterfsd/src/glusterfsd.c
@@ -2143,7 +2143,7 @@ parse_cmdline (int argc, char *argv[], glusterfs_ctx_t *ctx)
}
if (cmd_args->thin_client) {
- len = strlen (cmd_args->volfile_id) + strlen ("gfproxy-client/");
+ len = strlen (cmd_args->volfile_id) + SLEN ("gfproxy-client/");
thin_volfileid = GF_CALLOC (1, len + 1, gf_common_mt_char);
snprintf (thin_volfileid, len + 1, "gfproxy-client/%s",
cmd_args->volfile_id);