summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/rbthash.h
diff options
context:
space:
mode:
authorRaghavendra G <raghavendra@gluster.com>2011-06-14 01:41:24 +0000
committerAnand Avati <avati@gluster.com>2011-06-14 22:37:35 -0700
commite8f67179ca60eb81a4b1fa92e37bd0eb6213d659 (patch)
tree8bc2cdba11d8a566671eee4334d9969bced2e573 /libglusterfs/src/rbthash.h
parent72d56ff2a8bd0eacfa8036f7583fc0dd4de460d0 (diff)
rbthashtable: implement traverser procedure.
Signed-off-by: Raghavendra G <raghavendra@gluster.com> Signed-off-by: Anand Avati <avati@gluster.com> BUG: 1059 (enhancements for getting statistics from performance translators) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1059
Diffstat (limited to 'libglusterfs/src/rbthash.h')
-rw-r--r--libglusterfs/src/rbthash.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/libglusterfs/src/rbthash.h b/libglusterfs/src/rbthash.h
index 73b5b8e3012..96d7a9a5166 100644
--- a/libglusterfs/src/rbthash.h
+++ b/libglusterfs/src/rbthash.h
@@ -24,6 +24,7 @@
#include "mem-pool.h"
#include "logging.h"
#include "common-utils.h"
+#include "list.h"
#include <pthread.h>
@@ -38,12 +39,14 @@ struct rbthash_bucket {
typedef struct rbthash_entry {
void *data;
void *key;
- int keylen;
- uint32_t keyhash;
+ int keylen;
+ uint32_t keyhash;
+ struct list_head list;
} rbthash_entry_t;
typedef uint32_t (*rbt_hasher_t) (void *data, int len);
typedef void (*rbt_data_destroyer_t) (void *data);
+typedef void (*rbt_traverse_t) (void *data, void *mydata);
typedef struct rbthash_table {
int size;
@@ -54,6 +57,7 @@ typedef struct rbthash_table {
rbt_hasher_t hashfunc;
rbt_data_destroyer_t dfunc;
gf_boolean_t pool_alloced;
+ struct list_head list;
} rbthash_table_t;
extern rbthash_table_t *
@@ -75,4 +79,8 @@ rbthash_replace (rbthash_table_t *tbl, void *key, int keylen, void *newdata);
extern void
rbthash_table_destroy (rbthash_table_t *tbl);
+
+extern void
+rbthash_table_traverse (rbthash_table_t *tbl, rbt_traverse_t traverse,
+ void *mydata);
#endif