summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src
diff options
context:
space:
mode:
authorPranith Kumar K <pranithk@gluster.com>2011-10-24 08:27:40 +0530
committerVijay Bellur <vijay@gluster.com>2011-10-28 04:54:08 -0700
commit8a88ae6ce413dacc363cb9d5802965d8c5dca332 (patch)
tree7ccd58ca12ba365681c07fc6722aa1953d5c4e8e /libglusterfs/src
parent966eb9d98c62568ee2a5292100eed32f66c9dac2 (diff)
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 <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'libglusterfs/src')
-rw-r--r--libglusterfs/src/dict.c22
-rw-r--r--libglusterfs/src/dict.h1
2 files changed, 23 insertions, 0 deletions
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 !!!!!!!
*/
diff --git a/libglusterfs/src/dict.h b/libglusterfs/src/dict.h
index 0d404997ee0..76a085ee7ef 100644
--- a/libglusterfs/src/dict.h
+++ b/libglusterfs/src/dict.h
@@ -73,6 +73,7 @@ void data_destroy (data_t *data);
int32_t dict_set (dict_t *this, char *key, data_t *value);
data_t *dict_get (dict_t *this, char *key);
void dict_del (dict_t *this, char *key);
+int dict_reset (dict_t *dict);
int32_t dict_serialized_length (dict_t *dict);
int32_t dict_serialize (dict_t *dict, char *buf);