summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/rbthash.c
diff options
context:
space:
mode:
Diffstat (limited to 'libglusterfs/src/rbthash.c')
-rw-r--r--libglusterfs/src/rbthash.c32
1 files changed, 11 insertions, 21 deletions
diff --git a/libglusterfs/src/rbthash.c b/libglusterfs/src/rbthash.c
index 64fe70a8e..0d7b9e521 100644
--- a/libglusterfs/src/rbthash.c
+++ b/libglusterfs/src/rbthash.c
@@ -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.
*/
@@ -201,7 +192,7 @@ rbthash_init_entry (rbthash_table_t *tbl, void *data, void *key, int keylen)
ret = 0;
free_entry:
if (ret == -1) {
- mem_put (tbl->entrypool, entry);
+ mem_put (entry);
entry = NULL;
}
@@ -217,8 +208,7 @@ rbthash_deinit_entry (rbthash_table_t *tbl, rbthash_entry_t *entry)
if (!entry)
return;
- if (entry->key)
- GF_FREE (entry->key);
+ GF_FREE (entry->key);
if (tbl) {
if ((entry->data) && (tbl->dfunc))
@@ -230,14 +220,14 @@ rbthash_deinit_entry (rbthash_table_t *tbl, rbthash_entry_t *entry)
}
UNLOCK (&tbl->tablelock);
- mem_put (tbl->entrypool, entry);
+ mem_put (entry);
}
return;
}
-inline struct rbthash_bucket *
+static inline struct rbthash_bucket *
rbthash_entry_bucket (rbthash_table_t *tbl, rbthash_entry_t * entry)
{
int nbucket = 0;
@@ -311,7 +301,7 @@ err:
return ret;
}
-inline struct rbthash_bucket *
+static inline struct rbthash_bucket *
rbthash_key_bucket (rbthash_table_t *tbl, void *key, int keylen)
{
uint32_t keyhash = 0;
@@ -398,7 +388,7 @@ rbthash_remove (rbthash_table_t *tbl, void *key, int keylen)
}
UNLOCK (&tbl->tablelock);
- mem_put (tbl->entrypool, entry);
+ mem_put (entry);
return dataref;
}