{dht-rebalance|glusterd-geo-rep|glusterd-utils|nfs|bd}.c: no dict_del before dict_set

There is no need to remove an item before re-setting it.

Compile-tested only!

Change-Id: I2869aec9ebf474859127b8b38d284246e6097e84
updates: bz#1193929
Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
This commit is contained in:
Yaniv Kaul 2018-08-19 08:08:23 +03:00 committed by Amar Tumballi
parent 5276e8f27e
commit 8b913eb752
5 changed files with 0 additions and 9 deletions

View File

@ -2116,7 +2116,6 @@ dht_migrate_file (xlator_t *this, loc_t *loc, xlator_t *from, xlator_t *to,
}
if (target_changed) {
dict_del (dict, conf->link_xattr_name);
dict_del (dict, GLUSTERFS_POSIXLK_COUNT);
ret = dict_set_str (dict, conf->link_xattr_name, to->name);
if (ret) {

View File

@ -1792,9 +1792,6 @@ glusterd_store_slave_in_info (glusterd_volinfo_t *volinfo, char *slave,
} else if (ret == -1) { /* Existing slave */
snprintf (key, 512, "slave%d", slave1.old_slvidx);
/* Delete present slave info(with old hostname) */
dict_del (volinfo->gsync_slaves, key);
gf_msg_debug (this->name, 0, "Replacing key:%s with new value"
":%s", key, value);

View File

@ -9962,7 +9962,6 @@ glusterd_profile_volume_use_rsp_dict (dict_t *aggr, dict_t *rsp_dict)
rsp_ctx.count = count;
rsp_ctx.dict = ctx_dict;
dict_foreach (rsp_dict, _profile_volume_add_friend_rsp, &rsp_ctx);
dict_del (ctx_dict, "count");
ret = dict_set_int32 (ctx_dict, "count", count + brick_count);
out:
return ret;
@ -11548,7 +11547,6 @@ glusterd_profile_volume_brick_rsp (void *pending_entry,
rsp_ctx.count = count;
rsp_ctx.dict = op_ctx;
dict_foreach (rsp_dict, _profile_volume_add_brick_rsp, &rsp_ctx);
dict_del (op_ctx, "count");
ret = dict_set_int32 (op_ctx, "count", count);
return ret;
}

View File

@ -1082,7 +1082,6 @@ nfs_init_state (xlator_t *this)
if (nfs->allow_insecure) {
/* blindly set both the options */
dict_del (this->options, "rpc-auth-allow-insecure");
ret = dict_set_str (this->options,
"rpc-auth-allow-insecure", "on");
if (ret == -1) {
@ -1090,7 +1089,6 @@ nfs_init_state (xlator_t *this)
NFS_MSG_DICT_SET_FAILED, "dict_set_str error");
goto free_foppool;
}
dict_del (this->options, "rpc-auth.ports.insecure");
ret = dict_set_str (this->options,
"rpc-auth.ports.insecure", "on");
if (ret == -1) {

View File

@ -1148,7 +1148,6 @@ bd_offload_getx_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
}
gf_asprintf (&bd, "%s:%ld", type, local->size);
local->bdatt->type = gf_strdup (type);
dict_del (local->dict, BD_XATTR);
dict_del (local->dict, LINKTO);
if (dict_set_dynstr (local->dict, BD_XATTR, bd)) {
op_errno = EINVAL;