From bc3253b070ee9bf44360e258046a07c5630661bc Mon Sep 17 00:00:00 2001 From: Venkatesh Somyajulu Date: Tue, 20 Nov 2012 23:18:10 +0530 Subject: Put _check_key_is_zero_filled outside _xattrop_index_action Change-Id: Ifb89a3a911213b2816a540a104558e7c3c13e23a BUG: 874498 Signed-off-by: Venkatesh Somyajulu Reviewed-on: http://review.gluster.org/4182 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- xlators/features/index/src/index.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'xlators/features/index') 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) { -- cgit