From 8a88ae6ce413dacc363cb9d5802965d8c5dca332 Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Mon, 24 Oct 2011 08:27:40 +0530 Subject: pump: Change crawl to accommodate afr_lookup changes Change-Id: I895574dd6fa411784eb5282c799ccf3ff7c65625 BUG: 3747 Reviewed-on: http://review.gluster.com/635 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- libglusterfs/src/dict.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'libglusterfs/src/dict.c') diff --git a/libglusterfs/src/dict.c b/libglusterfs/src/dict.c index 7fbacf7c3d0..cfa1b831758 100644 --- a/libglusterfs/src/dict.c +++ b/libglusterfs/src/dict.c @@ -1247,6 +1247,28 @@ fail: return new; } +static void +_remove (dict_t *dict, + char *key, + data_t *value, + void *unused) +{ + dict_del ((dict_t *)dict, key); +} + +int +dict_reset (dict_t *dict) +{ + int32_t ret = -1; + if (!dict) { + gf_log_callingfn ("dict", GF_LOG_WARNING, "dict is NULL"); + goto out; + } + dict_foreach (dict, _remove, NULL); + ret = 0; +out: + return ret; +} /* * !!!!!!! CLEANED UP CODE !!!!!!! */ -- cgit