From d6c99b6134f1eb90b3a8020c3538101df266e9b5 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Thu, 6 Sep 2012 00:13:04 +0530 Subject: libglusterfs/dict: make 'dict_t' a opaque object * ie, don't dereference dict_t pointer, instead use APIs everywhere * other than dict_t only 'data_t' should be the valid export from dict.h * added 'dict_foreach_fnmatch()' API * changed dict_lookup() to use data_t, instead of data_pair_t Change-Id: I400bb0dd55519a7c5d2a107e67c8e7a7207228dc Signed-off-by: Amar Tumballi BUG: 850917 Reviewed-on: http://review.gluster.org/3829 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- xlators/features/index/src/index.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'xlators/features/index') diff --git a/xlators/features/index/src/index.c b/xlators/features/index/src/index.c index 071a25b4b..a98236c1e 100644 --- a/xlators/features/index/src/index.c +++ b/xlators/features/index/src/index.c @@ -435,20 +435,22 @@ out: void _xattrop_index_action (xlator_t *this, inode_t *inode, dict_t *xattr) { - data_pair_t *trav = NULL; gf_boolean_t zero_xattr = _gf_true; index_inode_ctx_t *ctx = NULL; int ret = 0; - trav = xattr->members_list; - while (trav && inode) { - if (mem_0filled ((const char*)trav->value->data, - trav->value->len)) { + 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; - break; + /* -1 means, no more iterations, treat as 'break' */ + return -1; } - trav = trav->next; + return 0; } + dict_foreach (xattr, _check_key_is_zero_filled, NULL); + ret = index_inode_ctx_get (inode, this, &ctx); if (ret) { gf_log (this->name, GF_LOG_ERROR, "Not able to %s %s -> index", -- cgit