diff options
author | Yaniv Kaul <ykaul@redhat.com> | 2018-09-13 16:03:23 +0300 |
---|---|---|
committer | Pranith Kumar Karampuri <pkarampu@redhat.com> | 2018-12-17 11:39:14 +0000 |
commit | 403c69d35827b6cbb430e97a797c318cca81e86e (patch) | |
tree | cd994bb5b8f133a1d8b1aa56d5c17deb3e91fae0 /xlators/cluster/afr/src/afr-self-heal-data.c | |
parent | f0c46df09fe542d6a365adc0c544ba460598501c (diff) |
AFR xlator: use dict_{setn|getn|deln|get_int32n|set_int32n|set_strn}
In a previous patch (https://review.gluster.org/20769) we've
added the key length to be passed to dict_* funcs, to remove the need
to strlen() it. This patch moves some xlators to use it.
- In some cases, moved strlen() of the key length outside of locks,
which is usually a good thing. Please verify it's safe to do so.
- In some cases, created a prefix for the keys, replacing something like
"%d-%d" with a "%s" in snprintf(). Not sure it adds value, but improves
readability.
Please review carefully.
Compile-tested only!
Change-Id: I04f2a1eb2ecfc3283d849d150d10d088ae7aa7f1
updates: bz#1193929
Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr-self-heal-data.c')
-rw-r--r-- | xlators/cluster/afr/src/afr-self-heal-data.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heal-data.c b/xlators/cluster/afr/src/afr-self-heal-data.c index 747060b170a..1dd18b363e0 100644 --- a/xlators/cluster/afr/src/afr-self-heal-data.c +++ b/xlators/cluster/afr/src/afr-self-heal-data.c @@ -73,7 +73,7 @@ __afr_can_skip_data_block_heal(call_frame_t *frame, xlator_t *this, fd_t *fd, xdata = dict_new(); if (!xdata) goto out; - if (dict_set_int32(xdata, "check-zero-filled", 1)) { + if (dict_set_int32_sizen(xdata, "check-zero-filled", 1)) { dict_unref(xdata); goto out; } |