-/**
- * Drop the refcount in cases where the caller holds a spinlock.
- *
- * This is needed if the caller cannot be blocked while freeing memory.
- * It assumes that there is some other known refcount held on the \a pool
- * and the memory cannot actually be freed, but the refcounting needs to
- * be kept accurate.
- *
- * \param[in] pool pool descriptor on which to drop reference
- */
-static void pool_putref_locked(struct pool_desc *pool)
-{
- CDEBUG(D_INFO, "pool %p\n", pool);
- LASSERT(atomic_read(&pool->pool_refcount) > 1);
-
- atomic_dec(&pool->pool_refcount);
-}
-
-/*
- * Group of functions needed for cfs_hash implementation. This
- * includes pool lookup, refcounting, and cleanup.
- */
-
-/**
- * Hash the pool name for use by the cfs_hash handlers.
- *
- * Use the standard DJB2 hash function for ASCII strings in Lustre.
- *
- * \param[in] hash_body hash structure where this key is embedded (unused)
- * \param[in] key key to be hashed (in this case the pool name)
- * \param[in] mask bitmask to limit the hash value to the desired size
- *
- * \retval computed hash value from \a key and limited by \a mask
- */
-static __u32 pool_hashfn(cfs_hash_t *hash_body, const void *key, unsigned mask)
-{
- return cfs_hash_djb2_hash(key, strnlen(key, LOV_MAXPOOLNAME), mask);
-}
-
-/**
- * Return the actual key (pool name) from the hashed \a hnode.
- *
- * Allows extracting the key name when iterating over all hash entries.
- *
- * \param[in] hnode hash node found by lookup or iteration
- *
- * \retval char array referencing the pool name (no refcount)
- */
-static void *pool_key(cfs_hlist_node_t *hnode)
-{
- struct pool_desc *pool;
-
- pool = cfs_hlist_entry(hnode, struct pool_desc, pool_hash);
- return pool->pool_name;
-}
-
-/**
- * Check if the specified hash key matches the hash node.
- *
- * This is needed in case there is a hash key collision, allowing the hash
- * table lookup/iteration to distinguish between the two entries.
- *
- * \param[in] key key (pool name) being searched for
- * \param[in] compared current entry being compared
- *
- * \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)
-{
- return !strncmp(key, pool_key(compared), LOV_MAXPOOLNAME);
-}
-
-/**
- * Return the actual pool data structure from the hash table entry.
- *
- * Once the hash table entry is found, extract the pool data from it.
- * The return type of this function is void * because it needs to be
- * assigned to the generic hash operations table.
- *
- * \param[in] hnode hash table entry
- *
- * \retval struct pool_desc for the specified \a 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)