summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht/src/dht-common.c
diff options
context:
space:
mode:
authorKrutika Dhananjay <kdhananj@redhat.com>2017-02-09 21:12:17 +0530
committerRaghavendra G <rgowdapp@redhat.com>2017-02-13 01:48:17 -0500
commitc6304c339104b0655473ee928659fdc4fa7cb2d9 (patch)
tree5e789459bfa0208708e0f4eca370f066945b16c3 /xlators/cluster/dht/src/dht-common.c
parent3ec11e0d2fbff4e8e8cbda0aac6d7b4603722e48 (diff)
cluster/dht: Use int8 instead of string to pass DHT_IATT_IN_XDATA_KEY
It is sufficient to pass an int value as opposed to a "yes" against the DHT_IATT_IN_XDATA_KEY key since all posix cares about is whether the key is present in the dict or not. Also note that this patch does not violate backward compatibility since the handling of the key in posix remains untouched. Change-Id: I2f881494a257488709c8c1d2002f2d124ddcc089 BUG: 1390050 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: https://review.gluster.org/16591 Smoke: Gluster Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: N Balachandran <nbalacha@redhat.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'xlators/cluster/dht/src/dht-common.c')
-rw-r--r--xlators/cluster/dht/src/dht-common.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c
index 31bea00..e8fde70 100644
--- a/xlators/cluster/dht/src/dht-common.c
+++ b/xlators/cluster/dht/src/dht-common.c
@@ -3847,8 +3847,7 @@ dht_fsetxattr (call_frame_t *frame, xlator_t *this,
xdata = xdata ? dict_ref (xdata) : dict_new ();
if (xdata)
- ret = dict_set_dynstr_with_alloc (xdata,
- DHT_IATT_IN_XDATA_KEY, "yes");
+ ret = dict_set_int8 (xdata, DHT_IATT_IN_XDATA_KEY, 1);
if (ret) {
gf_msg_debug (this->name, 0,
"Failed to set dictionary key %s for fd=%p",
@@ -4256,8 +4255,7 @@ dht_setxattr (call_frame_t *frame, xlator_t *this,
xdata = xdata ? dict_ref (xdata) : dict_new ();
if (xdata)
- ret = dict_set_dynstr_with_alloc (xdata,
- DHT_IATT_IN_XDATA_KEY, "yes");
+ ret = dict_set_int8 (xdata, DHT_IATT_IN_XDATA_KEY, 1);
STACK_WIND_COOKIE (frame, dht_file_setxattr_cbk, subvol,
subvol, subvol->fops->setxattr, loc, xattr,
@@ -4495,8 +4493,7 @@ dht_removexattr (call_frame_t *frame, xlator_t *this,
local->call_cnt = 1;
xdata = xdata ? dict_ref (xdata) : dict_new ();
if (xdata)
- ret = dict_set_dynstr_with_alloc (xdata,
- DHT_IATT_IN_XDATA_KEY, "yes");
+ ret = dict_set_int8 (xdata, DHT_IATT_IN_XDATA_KEY, 1);
if (ret) {
gf_msg (this->name, GF_LOG_ERROR, ENOMEM,
DHT_MSG_DICT_SET_FAILED, "Failed to "
@@ -4585,8 +4582,7 @@ dht_fremovexattr (call_frame_t *frame, xlator_t *this,
local->call_cnt = 1;
xdata = xdata ? dict_ref (xdata) : dict_new ();
if (xdata)
- ret = dict_set_dynstr_with_alloc (xdata,
- DHT_IATT_IN_XDATA_KEY, "yes");
+ ret = dict_set_int8 (xdata, DHT_IATT_IN_XDATA_KEY, 1);
if (ret) {
gf_msg (this->name, GF_LOG_ERROR, ENOMEM,
DHT_MSG_DICT_SET_FAILED, "Failed to "