From 8d171374cbbbdd88c8714198903b317bd132e1e2 Mon Sep 17 00:00:00 2001 From: Yaniv Kaul Date: Tue, 21 Aug 2018 19:18:17 +0300 Subject: 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 --- libglusterfs/src/glusterfs.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'libglusterfs/src/glusterfs.h') diff --git a/libglusterfs/src/glusterfs.h b/libglusterfs/src/glusterfs.h index 1fae5e7c1be..423804300a3 100644 --- a/libglusterfs/src/glusterfs.h +++ b/libglusterfs/src/glusterfs.h @@ -130,13 +130,13 @@ (strncmp (x, GF_XATTR_USER_PATHINFO_KEY, \ strlen (x)) == 0)) #define XATTR_IS_NODE_UUID(x) (strncmp (x, GF_XATTR_NODE_UUID_KEY, \ - strlen (GF_XATTR_NODE_UUID_KEY)) == 0) + SLEN (GF_XATTR_NODE_UUID_KEY)) == 0) #define XATTR_IS_NODE_UUID_LIST(x) (strncmp (x, GF_XATTR_LIST_NODE_UUIDS_KEY, \ - strlen (GF_XATTR_LIST_NODE_UUIDS_KEY)) == 0) + SLEN (GF_XATTR_LIST_NODE_UUIDS_KEY)) == 0) #define XATTR_IS_LOCKINFO(x) (strncmp (x, GF_XATTR_LOCKINFO_KEY, \ - strlen (GF_XATTR_LOCKINFO_KEY)) == 0) + SLEN (GF_XATTR_LOCKINFO_KEY)) == 0) -#define XATTR_IS_BD(x) (strncmp (x, BD_XATTR_KEY, strlen (BD_XATTR_KEY)) == 0) +#define XATTR_IS_BD(x) (strncmp (x, BD_XATTR_KEY, SLEN (BD_XATTR_KEY)) == 0) #define GF_XATTR_LINKINFO_KEY "trusted.distribute.linkinfo" #define GFID_XATTR_KEY "trusted.gfid" -- cgit