diff options
author | Raghavendra G <raghavendra@gluster.com> | 2009-10-28 18:42:35 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2009-10-28 23:00:39 -0700 |
commit | 53ff4f0299cf14c6c413d3e49991a6f05f9cda19 (patch) | |
tree | 62d74188e56d23d4076aa7da7df151e39067f7bd /libglusterfs/src/rbthash.h | |
parent | 07e8d8a37713d39f63713d8c05dd99a0610a3c35 (diff) |
libglusterfs/rbtree: change rbthash_init_table to take no of expected entries in the hash table as argument.
- the expected number of entries is used to create the memory pool of the hash
table. Having constant macro for this purpose is not suitable since different
users of rbtree based hash table store different number of entries in the
table.
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 335 (Io-cache optimization)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=335
Diffstat (limited to 'libglusterfs/src/rbthash.h')
-rw-r--r-- | libglusterfs/src/rbthash.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libglusterfs/src/rbthash.h b/libglusterfs/src/rbthash.h index 5bfa6afd0ef..f2200f8957c 100644 --- a/libglusterfs/src/rbthash.h +++ b/libglusterfs/src/rbthash.h @@ -26,7 +26,7 @@ #include <pthread.h> -#define GF_RBTHASH_MEMPOOL 1048576 +#define GF_RBTHASH_MEMPOOL 16384 //1048576 #define GF_RBTHASH "rbthash" struct rbthash_bucket { @@ -56,7 +56,7 @@ typedef struct rbthash_table { extern rbthash_table_t * rbthash_table_init (int buckets, rbt_hasher_t hfunc, - rbt_data_destroyer_t dfunc); + rbt_data_destroyer_t dfunc, unsigned long expected_entries); extern int rbthash_insert (rbthash_table_t *tbl, void *data, void *key, int keylen); |