diff options
Diffstat (limited to 'libglusterfs/src/rbthash.h')
| -rw-r--r-- | libglusterfs/src/rbthash.h | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/libglusterfs/src/rbthash.h b/libglusterfs/src/rbthash.h index 73b5b8e30..b093ce998 100644 --- a/libglusterfs/src/rbthash.h +++ b/libglusterfs/src/rbthash.h @@ -1,20 +1,11 @@ /* - Copyright (c) 2008-2010 Gluster, Inc. <http://www.gluster.com> + Copyright (c) 2008-2012 Red Hat, Inc. <http://www.redhat.com> This file is part of GlusterFS. - GlusterFS is free software; you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - GlusterFS is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see - <http://www.gnu.org/licenses/>. + This file is licensed to you under your choice of the GNU Lesser + General Public License, version 3 or any later version (LGPLv3 or + later), or the GNU General Public License, version 2 (GPLv2), in all + cases as published by the Free Software Foundation. */ #ifndef __RBTHASH_TABLE_H_ @@ -24,6 +15,7 @@ #include "mem-pool.h" #include "logging.h" #include "common-utils.h" +#include "list.h" #include <pthread.h> @@ -38,12 +30,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 +48,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 +70,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 |
