diff options
author | Yaniv Kaul <ykaul@redhat.com> | 2018-08-21 19:18:17 +0300 |
---|---|---|
committer | Amar Tumballi <amarts@redhat.com> | 2018-08-29 06:09:10 +0000 |
commit | 8d171374cbbbdd88c8714198903b317bd132e1e2 (patch) | |
tree | b10e6fd5ba8b79d41e79c2d22757a5d3e82576a4 /xlators/cluster/afr/src/afr-inode-read.c | |
parent | 60ef38482cc8d61711ecc48159cf6c036b1522a8 (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 'xlators/cluster/afr/src/afr-inode-read.c')
-rw-r--r-- | xlators/cluster/afr/src/afr-inode-read.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/xlators/cluster/afr/src/afr-inode-read.c b/xlators/cluster/afr/src/afr-inode-read.c index e8192a2b753..350d0325470 100644 --- a/xlators/cluster/afr/src/afr-inode-read.c +++ b/xlators/cluster/afr/src/afr-inode-read.c @@ -435,7 +435,7 @@ __gather_xattr_keys (dict_t *dict, char *key, data_t *value, struct _xattr_key * xkey = NULL; if (!strncmp (key, AFR_XATTR_PREFIX, - strlen (AFR_XATTR_PREFIX))) { + SLEN (AFR_XATTR_PREFIX))) { xkey = GF_CALLOC (1, sizeof (*xkey), gf_afr_mt_xattr_key); if (!xkey) @@ -814,7 +814,7 @@ unlock: /*Since we store the UUID0_STR as node uuid for down bricks and *for non zero op_ret, assigning length to priv->child_count *number of uuids*/ - local->cont.getxattr.xattr_len = (strlen (UUID0_STR) + 2) * + local->cont.getxattr.xattr_len = (SLEN (UUID0_STR) + 2) * priv->child_count; if (!local->dict) @@ -1214,7 +1214,7 @@ unlock: /* extra bytes for decorations (brackets and <>'s) */ padding += strlen (this->name) - + strlen (AFR_PATHINFO_HEADER) + 4; + + SLEN (AFR_PATHINFO_HEADER) + 4; local->cont.getxattr.xattr_len += (padding + 2); xattr_serz = GF_CALLOC (local->cont.getxattr.xattr_len, @@ -1339,7 +1339,7 @@ unlock: goto unwind; /* extra bytes for decorations (brackets and <>'s) */ - padding += strlen (this->name) + strlen (AFR_PATHINFO_HEADER) + 4; + padding += strlen (this->name) + SLEN (AFR_PATHINFO_HEADER) + 4; local->cont.getxattr.xattr_len += (padding + 2); xattr_serz = GF_CALLOC (local->cont.getxattr.xattr_len, @@ -1460,14 +1460,14 @@ afr_is_special_xattr (const char *name, fop_getxattr_cbk_t *cbk, *cbk = afr_getxattr_pathinfo_cbk; } } else if (!strncmp (name, GF_XATTR_CLRLK_CMD, - strlen (GF_XATTR_CLRLK_CMD))) { + SLEN (GF_XATTR_CLRLK_CMD))) { if (is_fgetxattr) { *cbk = afr_fgetxattr_clrlk_cbk; } else { *cbk = afr_getxattr_clrlk_cbk; } } else if (!strncmp (name, GF_XATTR_LOCKINFO_KEY, - strlen (GF_XATTR_LOCKINFO_KEY))) { + SLEN (GF_XATTR_LOCKINFO_KEY))) { if (is_fgetxattr) { *cbk = afr_fgetxattr_lockinfo_cbk; } else { @@ -1633,7 +1633,7 @@ afr_getxattr (call_frame_t *frame, xlator_t *this, } if (!strncmp (name, AFR_XATTR_PREFIX, - strlen (AFR_XATTR_PREFIX))) { + SLEN (AFR_XATTR_PREFIX))) { op_errno = ENODATA; goto out; } |