diff options
author | Yaniv Kaul <ykaul@redhat.com> | 2018-08-21 23:35:58 +0300 |
---|---|---|
committer | Pranith Kumar Karampuri <pkarampu@redhat.com> | 2018-09-04 04:02:56 +0000 |
commit | 6d5d3d1d095a7df2b49b56246021d302a4b7d695 (patch) | |
tree | 9bf8e010d541a1a6324d1fa5aa2aa8c0b11fe7bf /xlators/cluster/afr/src | |
parent | 13deb311b2a48170489bb4f7cfd7def982281fd4 (diff) |
xlators/cluster/afr/src/afr-inode-read.c: move to GF_MALLOC() instead of GF_CALLOC() when
It doesn't make sense to calloc (allocate and clear) memory
when the code right away fills that memory with data.
It may be optimized by the compiler, or have a microscopic
performance improvement.
Please review carefully, especially for string allocation, with the
terminating NULL string.
Only compile-tested!
Change-Id: Ief156de98769fea852553044a398a309e831754b
updates: bz#1193929
Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
Diffstat (limited to 'xlators/cluster/afr/src')
-rw-r--r-- | xlators/cluster/afr/src/afr-inode-read.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/xlators/cluster/afr/src/afr-inode-read.c b/xlators/cluster/afr/src/afr-inode-read.c index 350d0325470..2675af2bf99 100644 --- a/xlators/cluster/afr/src/afr-inode-read.c +++ b/xlators/cluster/afr/src/afr-inode-read.c @@ -437,7 +437,7 @@ __gather_xattr_keys (dict_t *dict, char *key, data_t *value, if (!strncmp (key, AFR_XATTR_PREFIX, SLEN (AFR_XATTR_PREFIX))) { - xkey = GF_CALLOC (1, sizeof (*xkey), gf_afr_mt_xattr_key); + xkey = GF_MALLOC (sizeof (*xkey), gf_afr_mt_xattr_key); if (!xkey) return -1; |