Whamcloud - gitweb
LU-4974 lod: use pool_key() to access key 44/10244/4
authorAndreas Dilger <andreas.dilger@intel.com>
Wed, 7 May 2014 06:24:23 +0000 (00:24 -0600)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 24 Jul 2014 03:09:40 +0000 (03:09 +0000)
In pool_hashkey_keycmp() use the pool_key() function instead of open
coding the key access.

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Change-Id: Ia618e25ed4f086321865a9439142e43405500c1e
Reviewed-on: http://review.whamcloud.com/10244
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Liang Zhen <liang.zhen@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/lod/lod_pool.c

index 1404073..aad13f4 100644 (file)
@@ -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);
 }
 
 /**