diff options
author | Venkatesh Somyajulu <vsomyaju@redhat.com> | 2012-11-20 23:18:10 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2012-11-20 22:35:49 -0800 |
commit | bc3253b070ee9bf44360e258046a07c5630661bc (patch) | |
tree | 1893fe681727b77d65e52e35bdf68ec71d60c4a8 /xlators/features | |
parent | 961bc80c7aeedaa0bdc580f9f08d1c8a2a0992cd (diff) |
Put _check_key_is_zero_filled outside _xattrop_index_action
Change-Id: Ifb89a3a911213b2816a540a104558e7c3c13e23a
BUG: 874498
Signed-off-by: Venkatesh Somyajulu <vsomyaju@redhat.com>
Reviewed-on: http://review.gluster.org/4182
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/features')
-rw-r--r-- | xlators/features/index/src/index.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/xlators/features/index/src/index.c b/xlators/features/index/src/index.c index 24efcbb3a70..d1eb763de8a 100644 --- a/xlators/features/index/src/index.c +++ b/xlators/features/index/src/index.c @@ -430,6 +430,16 @@ index_del (xlator_t *this, uuid_t gfid, const char *subdir) out: return ret; } +int +_check_key_is_zero_filled (dict_t *d, char *k, data_t *v, + void *tmp) +{ + if (mem_0filled ((const char*)v->data, v->len)) { + /* -1 means, no more iterations, treat as 'break' */ + return -1; + } + return 0; +} void _xattrop_index_action (xlator_t *this, inode_t *inode, dict_t *xattr) @@ -438,17 +448,9 @@ _xattrop_index_action (xlator_t *this, inode_t *inode, dict_t *xattr) index_inode_ctx_t *ctx = NULL; int ret = 0; - int _check_key_is_zero_filled (dict_t *d, char *k, data_t *v, - void *tmp) - { - if (mem_0filled ((const char*)v->data, v->len)) { - zero_xattr = _gf_false; - /* -1 means, no more iterations, treat as 'break' */ - return -1; - } - return 0; - } - dict_foreach (xattr, _check_key_is_zero_filled, NULL); + ret = dict_foreach (xattr, _check_key_is_zero_filled, NULL); + if (ret == -1) + zero_xattr = _gf_false; ret = index_inode_ctx_get (inode, this, &ctx); if (ret) { |