From 9404b0de3fd8ab5adc3a531d4cb37b56e1e3908f Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Fri, 5 Jan 2018 13:51:18 +0530 Subject: core: fix some of the dict_{get,set} with proper APIs updates #220 Change-Id: I6e25dbb69b2c7021e00073e8f025d212db7de0be Signed-off-by: Amar Tumballi --- xlators/cluster/afr/src/afr-common.c | 5 ++--- xlators/cluster/afr/src/afr-self-heal-common.c | 2 +- xlators/cluster/afr/src/afr-self-heal-entry.c | 4 ++-- xlators/cluster/dht/src/dht-common.c | 4 ++-- xlators/cluster/dht/src/dht-linkfile.c | 2 +- xlators/cluster/dht/src/dht-rebalance.c | 4 ++-- xlators/cluster/dht/src/dht-selfheal.c | 2 +- xlators/cluster/stripe/src/stripe.c | 2 +- 8 files changed, 12 insertions(+), 13 deletions(-) (limited to 'xlators/cluster') diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c index 42a82f006b4..96419c6df5a 100644 --- a/xlators/cluster/afr/src/afr-common.c +++ b/xlators/cluster/afr/src/afr-common.c @@ -3163,7 +3163,6 @@ afr_lookup (call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xattr_req) afr_local_t *local = NULL; int32_t op_errno = 0; int event = 0; - void *gfid_req = NULL; int ret = 0; if (loc_is_nameless (loc)) { @@ -3203,9 +3202,9 @@ afr_lookup (call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xattr_req) op_errno = ENOMEM; goto out; } - ret = dict_get_ptr (local->xattr_req, "gfid-req", &gfid_req); + ret = dict_get_gfuuid (local->xattr_req, "gfid-req", + &local->cont.lookup.gfid_req); if (ret == 0) { - gf_uuid_copy (local->cont.lookup.gfid_req, gfid_req); dict_del (local->xattr_req, "gfid-req"); } } diff --git a/xlators/cluster/afr/src/afr-self-heal-common.c b/xlators/cluster/afr/src/afr-self-heal-common.c index 88a3d9618e3..311da68e8ee 100644 --- a/xlators/cluster/afr/src/afr-self-heal-common.c +++ b/xlators/cluster/afr/src/afr-self-heal-common.c @@ -60,7 +60,7 @@ afr_lookup_and_heal_gfid (xlator_t *this, inode_t *parent, const char *name, goto out; } - ret = dict_set_static_bin (xdata, "gfid-req", gfid, 16); + ret = dict_set_gfuuid (xdata, "gfid-req", gfid, true); if (ret) { ret = -ENOMEM; goto out; diff --git a/xlators/cluster/afr/src/afr-self-heal-entry.c b/xlators/cluster/afr/src/afr-self-heal-entry.c index 647dd71911b..b601040504e 100644 --- a/xlators/cluster/afr/src/afr-self-heal-entry.c +++ b/xlators/cluster/afr/src/afr-self-heal-entry.c @@ -107,8 +107,8 @@ afr_selfheal_recreate_entry (call_frame_t *frame, int dst, int source, if (ret) goto out; - ret = dict_set_static_bin (xdata, "gfid-req", - replies[source].poststat.ia_gfid, 16); + ret = dict_set_gfuuid (xdata, "gfid-req", + replies[source].poststat.ia_gfid, true); if (ret) goto out; diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c index 4a16714177a..d54d54c5fc4 100644 --- a/xlators/cluster/dht/src/dht-common.c +++ b/xlators/cluster/dht/src/dht-common.c @@ -2895,8 +2895,8 @@ dht_lookup_directory (call_frame_t *frame, xlator_t *this, loc_t *loc) } if (!gf_uuid_is_null (local->gfid)) { - ret = dict_set_static_bin (local->xattr_req, "gfid-req", - local->gfid, 16); + ret = dict_set_gfuuid (local->xattr_req, "gfid-req", + local->gfid, true); if (ret) gf_msg (this->name, GF_LOG_WARNING, 0, DHT_MSG_DICT_SET_FAILED, diff --git a/xlators/cluster/dht/src/dht-linkfile.c b/xlators/cluster/dht/src/dht-linkfile.c index 101d93915b9..a6d994b4157 100644 --- a/xlators/cluster/dht/src/dht-linkfile.c +++ b/xlators/cluster/dht/src/dht-linkfile.c @@ -135,7 +135,7 @@ dht_linkfile_create (call_frame_t *frame, fop_mknod_cbk_t linkfile_cbk, if (!gf_uuid_is_null (local->gfid)) { gf_uuid_unparse(local->gfid, gfid); - ret = dict_set_static_bin (dict, "gfid-req", local->gfid, 16); + ret = dict_set_gfuuid (dict, "gfid-req", local->gfid, true); if (ret) gf_msg ("dht-linkfile", GF_LOG_INFO, 0, DHT_MSG_DICT_SET_FAILED, diff --git a/xlators/cluster/dht/src/dht-rebalance.c b/xlators/cluster/dht/src/dht-rebalance.c index f48ba19cc3d..70d5a5f316f 100644 --- a/xlators/cluster/dht/src/dht-rebalance.c +++ b/xlators/cluster/dht/src/dht-rebalance.c @@ -692,7 +692,7 @@ __dht_rebalance_create_dst_file (xlator_t *this, xlator_t *to, xlator_t *from, "path:%s", loc->path); goto out; } - ret = dict_set_static_bin (dict, "gfid-req", stbuf->ia_gfid, 16); + ret = dict_set_gfuuid (dict, "gfid-req", stbuf->ia_gfid, true); if (ret) { *fop_errno = ENOMEM; ret = -1; @@ -1336,7 +1336,7 @@ migrate_special_files (xlator_t *this, xlator_t *from, xlator_t *to, loc_t *loc, } /* Set the gfid of the source file in dict */ - ret = dict_set_static_bin (dict, "gfid-req", buf->ia_gfid, 16); + ret = dict_set_gfuuid (dict, "gfid-req", buf->ia_gfid, true); if (ret) { *fop_errno = ENOMEM; ret = -1; diff --git a/xlators/cluster/dht/src/dht-selfheal.c b/xlators/cluster/dht/src/dht-selfheal.c index d137e1303e5..b3ca4c2c281 100644 --- a/xlators/cluster/dht/src/dht-selfheal.c +++ b/xlators/cluster/dht/src/dht-selfheal.c @@ -1392,7 +1392,7 @@ dht_selfheal_dir_mkdir_lookup_done (call_frame_t *frame, xlator_t *this) if (!dict) return -1; - ret = dict_set_static_bin (dict, "gfid-req", local->gfid, 16); + ret = dict_set_gfuuid (dict, "gfid-req", local->gfid, true); if (ret) gf_msg (this->name, GF_LOG_WARNING, 0, DHT_MSG_DICT_SET_FAILED, diff --git a/xlators/cluster/stripe/src/stripe.c b/xlators/cluster/stripe/src/stripe.c index 5a8bf1a9275..fae80c3e200 100644 --- a/xlators/cluster/stripe/src/stripe.c +++ b/xlators/cluster/stripe/src/stripe.c @@ -124,7 +124,7 @@ stripe_entry_self_heal (call_frame_t *frame, xlator_t *this, if (!xdata) goto out; - ret = dict_set_static_bin (xdata, "gfid-req", local->stbuf.ia_gfid, 16); + ret = dict_set_gfuuid (xdata, "gfid-req", local->stbuf.ia_gfid, true); if (ret) gf_log (this->name, GF_LOG_WARNING, "%s: failed to set gfid-req", local->loc.path); -- cgit