From 0699c02116e76ce11a4489a8dbd4c983052f313b Mon Sep 17 00:00:00 2001 From: Andreas Dilger Date: Wed, 7 May 2014 00:24:23 -0600 Subject: [PATCH] LU-4974 lod: use pool_key() to access key In pool_hashkey_keycmp() use the pool_key() function instead of open coding the key access. Signed-off-by: Andreas Dilger Change-Id: Ia618e25ed4f086321865a9439142e43405500c1e Reviewed-on: http://review.whamcloud.com/10244 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Dmitry Eremin Reviewed-by: Liang Zhen Reviewed-by: Oleg Drokin --- lustre/lod/lod_pool.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/lustre/lod/lod_pool.c b/lustre/lod/lod_pool.c index 1404073..aad13f4 100644 --- a/lustre/lod/lod_pool.c +++ b/lustre/lod/lod_pool.c @@ -174,14 +174,9 @@ static void *pool_key(cfs_hlist_node_t *hnode) * \retval 0 if \a key is the same as the key of \a compared * \retval 1 if \a key is different from the key of \a compared */ -static int pool_hashkey_keycmp(const void *key, cfs_hlist_node_t *compared_hnode) +static int pool_hashkey_keycmp(const void *key, cfs_hlist_node_t *compared) { - char *pool_name; - struct pool_desc *pool; - - pool_name = (char *)key; - pool = cfs_hlist_entry(compared_hnode, struct pool_desc, pool_hash); - return !strncmp(pool_name, pool->pool_name, LOV_MAXPOOLNAME); + return !strncmp(key, pool_key(compared), LOV_MAXPOOLNAME); } /** -- 1.8.3.1