Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
LU-160 Reduce OST size requirement for test 155
[fs/lustre-release.git]
/
lustre
/
lov
/
lov_pool.c
diff --git
a/lustre/lov/lov_pool.c
b/lustre/lov/lov_pool.c
index
d3cd4f9
..
b6355bb
100644
(file)
--- a/
lustre/lov/lov_pool.c
+++ b/
lustre/lov/lov_pool.c
@@
-26,7
+26,7
@@
* GPL HEADER END
*/
/*
* GPL HEADER END
*/
/*
- * Copyright
2008 Sun Microsystems, Inc. All rights reserved
+ * Copyright
(c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*/
/*
* Use is subject to license terms.
*/
/*
@@
-73,6
+73,13
@@
void lov_pool_putref(struct pool_desc *pool)
}
}
}
}
+void lov_pool_putref_locked(struct pool_desc *pool)
+{
+ CDEBUG(D_INFO, "pool %p\n", pool);
+ LASSERT(cfs_atomic_read(&pool->pool_refcount) > 1);
+
+ cfs_atomic_dec(&pool->pool_refcount);
+}
/*
* hash function using a Rotating Hash algorithm
/*
* hash function using a Rotating Hash algorithm
@@
-81,7
+88,7
@@
void lov_pool_putref(struct pool_desc *pool)
* Chapter 6.4.
* Addison Wesley, 1973
*/
* Chapter 6.4.
* Addison Wesley, 1973
*/
-static __u32 pool_hashfn(cfs_hash_t *hash_body, void *key, unsigned mask)
+static __u32 pool_hashfn(cfs_hash_t *hash_body,
const
void *key, unsigned mask)
{
int i;
__u32 result;
{
int i;
__u32 result;
@@
-105,42
+112,46
@@
static void *pool_key(cfs_hlist_node_t *hnode)
return (pool->pool_name);
}
return (pool->pool_name);
}
-static int pool_hashkey_
compare(
void *key, cfs_hlist_node_t *compared_hnode)
+static int pool_hashkey_
keycmp(const
void *key, cfs_hlist_node_t *compared_hnode)
{
char *pool_name;
struct pool_desc *pool;
{
char *pool_name;
struct pool_desc *pool;
- int rc;
pool_name = (char *)key;
pool = cfs_hlist_entry(compared_hnode, struct pool_desc, pool_hash);
pool_name = (char *)key;
pool = cfs_hlist_entry(compared_hnode, struct pool_desc, pool_hash);
- rc = strncmp(pool_name, pool->pool_name, LOV_MAXPOOLNAME);
- return (!rc);
+ return !strncmp(pool_name, pool->pool_name, LOV_MAXPOOLNAME);
}
}
-static void *pool_hashrefcount_get(cfs_hlist_node_t *hnode)
+static void *pool_hashobject(cfs_hlist_node_t *hnode)
+{
+ return cfs_hlist_entry(hnode, struct pool_desc, pool_hash);
+}
+
+static void pool_hashrefcount_get(cfs_hash_t *hs, cfs_hlist_node_t *hnode)
{
struct pool_desc *pool;
pool = cfs_hlist_entry(hnode, struct pool_desc, pool_hash);
lov_pool_getref(pool);
{
struct pool_desc *pool;
pool = cfs_hlist_entry(hnode, struct pool_desc, pool_hash);
lov_pool_getref(pool);
- return (pool);
}
}
-static void *pool_hashrefcount_put(cfs_hlist_node_t *hnode)
+static void pool_hashrefcount_put_locked(cfs_hash_t *hs,
+ cfs_hlist_node_t *hnode)
{
struct pool_desc *pool;
pool = cfs_hlist_entry(hnode, struct pool_desc, pool_hash);
{
struct pool_desc *pool;
pool = cfs_hlist_entry(hnode, struct pool_desc, pool_hash);
- lov_pool_putref(pool);
- return (pool);
+ lov_pool_putref_locked(pool);
}
cfs_hash_ops_t pool_hash_operations = {
.hs_hash = pool_hashfn,
.hs_key = pool_key,
}
cfs_hash_ops_t pool_hash_operations = {
.hs_hash = pool_hashfn,
.hs_key = pool_key,
- .hs_compare = pool_hashkey_compare,
+ .hs_keycmp = pool_hashkey_keycmp,
+ .hs_object = pool_hashobject,
.hs_get = pool_hashrefcount_get,
.hs_get = pool_hashrefcount_get,
- .hs_put = pool_hashrefcount_put,
+ .hs_put_locked = pool_hashrefcount_put_locked,
+
};
#ifdef LPROCFS
};
#ifdef LPROCFS