summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/dict.c
diff options
context:
space:
mode:
Diffstat (limited to 'libglusterfs/src/dict.c')
-rw-r--r--libglusterfs/src/dict.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/libglusterfs/src/dict.c b/libglusterfs/src/dict.c
index 3b7ddce5e..f2df5a6d4 100644
--- a/libglusterfs/src/dict.c
+++ b/libglusterfs/src/dict.c
@@ -1086,6 +1086,20 @@ dict_null_foreach_fn (dict_t *d, char *k,
}
int
+dict_remove_foreach_fn (dict_t *d, char *k,
+ data_t *v, void *_tmp)
+{
+ if (!d || !k) {
+ gf_log ("glusterfs", GF_LOG_WARNING, "%s is NULL",
+ d?"key":"dictionary");
+ return -1;
+ }
+
+ dict_del (d, k);
+ return 0;
+}
+
+int
dict_foreach (dict_t *dict,
int (*fn)(dict_t *this,
char *key,