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/performance/md-cache/src/md-cache.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'xlators/performance') diff --git a/xlators/performance/md-cache/src/md-cache.c b/xlators/performance/md-cache/src/md-cache.c index 55923990d..237acab9f 100644 --- a/xlators/performance/md-cache/src/md-cache.c +++ b/xlators/performance/md-cache/src/md-cache.c @@ -455,7 +455,7 @@ struct updatedict { int ret; }; -static void +static int updatefn(dict_t *dict, char *key, data_t *value, void *data) { struct updatedict *u = data; @@ -472,17 +472,18 @@ updatefn(dict_t *dict, char *key, data_t *value, void *data) u->dict = dict_new(); if (!u->dict) { u->ret = -1; - return; + return -1; } } if (dict_set(u->dict, key, value) < 0) { u->ret = -1; - return; + return -1; } break; } + return 0; } static int @@ -651,13 +652,15 @@ is_mdc_key_satisfied (const char *key) } -static void +static int checkfn (dict_t *this, char *key, data_t *value, void *data) { struct checkpair *pair = data; if (!is_mdc_key_satisfied (key)) pair->ret = 0; + + return 0; } -- cgit