summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-bitrot.c
diff options
context:
space:
mode:
authorYaniv Kaul <ykaul@redhat.com>2018-08-21 19:33:16 +0300
committerAmar Tumballi <amarts@redhat.com>2018-08-31 02:14:06 +0000
commitd6d729b0609957c0382749c30da507dda77561b7 (patch)
treef267deebe2735e1aed4890b31f2e894a04221b58 /xlators/mgmt/glusterd/src/glusterd-bitrot.c
parent437455c1608a0c644d14798551c77e9513ba9901 (diff)
xlators: move from strlen() to sizeof()
xlators/features/index/src/index.c xlators/features/shard/src/shard.c xlators/features/upcall/src/upcall-internal.c xlators/mgmt/glusterd/src/glusterd-bitrot.c xlators/mgmt/glusterd/src/glusterd-locks.c xlators/mgmt/glusterd/src/glusterd-mountbroker.c xlators/mgmt/glusterd/src/glusterd-op-sm.c For const strings, just do compile time size calc instead of runtime. Compile-tested only! Change-Id: I995b2b89f14454b3855a4cd0ca90b3f01d5e080f updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-bitrot.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-bitrot.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-bitrot.c b/xlators/mgmt/glusterd/src/glusterd-bitrot.c
index a9e0269..10babdb 100644
--- a/xlators/mgmt/glusterd/src/glusterd-bitrot.c
+++ b/xlators/mgmt/glusterd/src/glusterd-bitrot.c
@@ -130,7 +130,7 @@ __glusterd_handle_bitrot (rpcsvc_request_t *req)
goto out;
}
- if (!strncmp (scrub, "status", strlen ("status"))) {
+ if (!strncmp (scrub, "status", SLEN ("status"))) {
ret = glusterd_op_begin_synctask (req,
GD_OP_SCRUB_STATUS,
dict);
@@ -158,7 +158,7 @@ __glusterd_handle_bitrot (rpcsvc_request_t *req)
goto out;
}
- if (!strncmp (scrub, "ondemand", strlen ("ondemand"))) {
+ if (!strncmp (scrub, "ondemand", SLEN ("ondemand"))) {
ret = glusterd_op_begin_synctask (req,
GD_OP_SCRUB_ONDEMAND,
dict);
@@ -715,8 +715,8 @@ glusterd_op_stage_bitrot (dict_t *dict, char **op_errstr, dict_t *rsp_dict)
* "Active" in the dictionary. */
if (!strcmp (scrub_cmd_from_dict, scrub_cmd) ||
(!strncmp ("Active", scrub_cmd_from_dict,
- strlen("Active")) && !strncmp ("resume",
- scrub_cmd, strlen("resume")))) {
+ SLEN ("Active")) && !strncmp ("resume",
+ scrub_cmd, SLEN ("resume")))) {
snprintf (msg, sizeof (msg), "Scrub is already"
" %sd for volume %s", scrub_cmd,
volinfo->volname);