/* To remove an element without calling the free function, call xfs_mru_cache_remove() with the data store and the element's key. On success the client data pointer for the removed element is returned, otherwise this function will return a NULL pointer.  */
void* xfs_mru_cache_remove(xfs_mru_cache_t *mru, unsigned long key)
/* To remove an element without calling the free function, call xfs_mru_cache_remove() with the data store and the element's key. On success the client data pointer for the removed element is returned, otherwise this function will return a NULL pointer.  */
void* xfs_mru_cache_remove(xfs_mru_cache_t *mru, unsigned long key)
{
	xfs_mru_cache_elem_t *elem;
	void		*value = NULL;
	ASSERT(mru && mru->lists);
	if (!mru || !mru->lists)
		return NULL;
	spin_lock(&mru->lock);
	elem = radix_tree_delete(&mru->store, key);
	if (elem) {
		value = elem->value;
		list_del(&elem->list_node);
	}
	spin_unlock(&mru->lock);
	if (elem)
		kmem_zone_free(xfs_mru_elem_zone, elem);
	return value;
}