diff options
Diffstat (limited to 'xlators/features/shard')
-rw-r--r-- | xlators/features/shard/src/shard.c | 8 | ||||
-rw-r--r-- | xlators/features/shard/src/shard.h | 6 |
2 files changed, 8 insertions, 6 deletions
diff --git a/xlators/features/shard/src/shard.c b/xlators/features/shard/src/shard.c index 6c075ac5bf..a12e553f95 100644 --- a/xlators/features/shard/src/shard.c +++ b/xlators/features/shard/src/shard.c @@ -1357,7 +1357,7 @@ shard_lookup_internal_dir (call_frame_t *frame, xlator_t *this, priv = this->private; local->post_res_handler = post_res_handler; - gfid = GF_CALLOC (1, sizeof(uuid_t), gf_common_mt_uuid_t); + gfid = GF_MALLOC (sizeof(uuid_t), gf_common_mt_uuid_t); if (!gfid) goto err; @@ -1378,6 +1378,7 @@ shard_lookup_internal_dir (call_frame_t *frame, xlator_t *this, loc = &local->dot_shard_rm_loc; break; default: + bzero(*gfid, sizeof(uuid_t)); break; } @@ -2266,7 +2267,7 @@ shard_create_gfid_dict (dict_t *dict) if (!new) return NULL; - gfid = GF_CALLOC (1, sizeof (uuid_t), gf_common_mt_char); + gfid = GF_MALLOC (sizeof (uuid_t), gf_common_mt_char); if (!gfid) { ret = -1; goto out; @@ -5615,7 +5616,7 @@ shard_mkdir_internal_dir (call_frame_t *frame, xlator_t *this, priv = this->private; local->post_res_handler = handler; - gfid = GF_CALLOC (1, sizeof(uuid_t), gf_common_mt_uuid_t); + gfid = GF_MALLOC (sizeof(uuid_t), gf_common_mt_uuid_t); if (!gfid) goto err; @@ -5629,6 +5630,7 @@ shard_mkdir_internal_dir (call_frame_t *frame, xlator_t *this, loc = &local->dot_shard_rm_loc; break; default: + bzero(*gfid, sizeof(uuid_t)); break; } diff --git a/xlators/features/shard/src/shard.h b/xlators/features/shard/src/shard.h index ac3813c8c5..7a263f4c37 100644 --- a/xlators/features/shard/src/shard.h +++ b/xlators/features/shard/src/shard.h @@ -120,7 +120,7 @@ shard_unlock_entrylk (call_frame_t *frame, xlator_t *this); int64_t *__size_attr = NULL; \ uint64_t *__bs = 0; \ \ - __bs = GF_CALLOC (1, sizeof (uint64_t), gf_shard_mt_uint64_t); \ + __bs = GF_MALLOC (sizeof (uint64_t), gf_shard_mt_uint64_t); \ if (!__bs) \ goto label; \ *__bs = hton64 (block_size); \ @@ -142,8 +142,8 @@ shard_unlock_entrylk (call_frame_t *frame, xlator_t *this); __size_attr, 8 * 4); \ if (__ret) { \ gf_msg (this->name, GF_LOG_WARNING, 0, \ - SHARD_MSG_DICT_OP_FAILED, "Failed to set key: %s " \ - "on path %s", GF_XATTR_SHARD_FILE_SIZE, (loc)->path); \ + SHARD_MSG_DICT_OP_FAILED, "Failed to set key: %s " \ + "on path %s", GF_XATTR_SHARD_FILE_SIZE, (loc)->path); \ GF_FREE (__size_attr); \ goto label; \ } \ |