summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr
diff options
context:
space:
mode:
authorPranith Kumar K <pkarampu@redhat.com>2018-09-28 13:03:38 +0530
committerAmar Tumballi <amarts@redhat.com>2018-10-15 04:05:30 +0000
commit76cc1ea613e038ced4bc6ae26233cb0681b63be5 (patch)
treeecca8321697c25951dbe94bb4b7d182040d567ac /xlators/cluster/afr
parentc962e2cbd73e78f31e690f7b1f8456616006c543 (diff)
libglusterfs/dict: Add sizeof()-1 variants of dict functions
One needs to be very careful about giving same key for the key and SLEN(key) arguments in dict_xxxn() functions. Writing macros that would take care of passing the SLEN(key) would help reduce this burden on the developer and reviewer. updates: bz#1193929 Change-Id: I312c479b919826570b47ae2c219c53e2f9b2ddef Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Diffstat (limited to 'xlators/cluster/afr')
-rw-r--r--xlators/cluster/afr/src/afr-inode-write.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/xlators/cluster/afr/src/afr-inode-write.c b/xlators/cluster/afr/src/afr-inode-write.c
index df807342b99..c6fe0939841 100644
--- a/xlators/cluster/afr/src/afr-inode-write.c
+++ b/xlators/cluster/afr/src/afr-inode-write.c
@@ -307,8 +307,8 @@ afr_inode_write_fill(call_frame_t *frame, xlator_t *this, int child_index,
local->update_open_fd_count = _gf_true;
}
- ret = dict_get_int32n(xdata, GLUSTERFS_INODELK_COUNT,
- SLEN(GLUSTERFS_INODELK_COUNT), &num_inodelks);
+ ret = dict_get_int32_sizen(xdata, GLUSTERFS_INODELK_COUNT,
+ &num_inodelks);
if (ret < 0)
goto unlock;
if (num_inodelks > local->num_inodelks) {
@@ -528,8 +528,8 @@ afr_writev(call_frame_t *frame, xlator_t *this, fd_t *fd, struct iovec *vector,
goto out;
}
- if (dict_set_strn(local->xdata_req, GLUSTERFS_INODELK_DOM_COUNT,
- SLEN(GLUSTERFS_INODELK_DOM_COUNT), this->name)) {
+ if (dict_set_str_sizen(local->xdata_req, GLUSTERFS_INODELK_DOM_COUNT,
+ this->name)) {
op_errno = ENOMEM;
goto out;
}