RDMA/rxe: Replace missing rxe_pool_get_index_locked
One of the pool APIs for when caller is holding lock was not defined but is declared in rxe_pool.h. This patch adds the definition. Link: https://lore.kernel.org/r/20210125211641.2694-7-rpearson@hpe.com Signed-off-by: Bob Pearson <rpearson@hpe.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
This commit is contained in:
Родитель
eae5f0642e
Коммит
ce2063e387
|
@ -398,15 +398,12 @@ void rxe_elem_release(struct kref *kref)
|
||||||
atomic_dec(&pool->num_elem);
|
atomic_dec(&pool->num_elem);
|
||||||
}
|
}
|
||||||
|
|
||||||
void *rxe_pool_get_index(struct rxe_pool *pool, u32 index)
|
void *rxe_pool_get_index_locked(struct rxe_pool *pool, u32 index)
|
||||||
{
|
{
|
||||||
struct rxe_type_info *info = &rxe_type_info[pool->type];
|
struct rxe_type_info *info = &rxe_type_info[pool->type];
|
||||||
struct rb_node *node;
|
struct rb_node *node;
|
||||||
struct rxe_pool_entry *elem;
|
struct rxe_pool_entry *elem;
|
||||||
u8 *obj = NULL;
|
u8 *obj;
|
||||||
unsigned long flags;
|
|
||||||
|
|
||||||
read_lock_irqsave(&pool->pool_lock, flags);
|
|
||||||
|
|
||||||
node = pool->index.tree.rb_node;
|
node = pool->index.tree.rb_node;
|
||||||
|
|
||||||
|
@ -428,6 +425,16 @@ void *rxe_pool_get_index(struct rxe_pool *pool, u32 index)
|
||||||
obj = NULL;
|
obj = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
|
|
||||||
|
void *rxe_pool_get_index(struct rxe_pool *pool, u32 index)
|
||||||
|
{
|
||||||
|
u8 *obj;
|
||||||
|
unsigned long flags;
|
||||||
|
|
||||||
|
read_lock_irqsave(&pool->pool_lock, flags);
|
||||||
|
obj = rxe_pool_get_index_locked(pool, index);
|
||||||
read_unlock_irqrestore(&pool->pool_lock, flags);
|
read_unlock_irqrestore(&pool->pool_lock, flags);
|
||||||
|
|
||||||
return obj;
|
return obj;
|
||||||
|
@ -438,7 +445,7 @@ void *rxe_pool_get_key_locked(struct rxe_pool *pool, void *key)
|
||||||
struct rxe_type_info *info = &rxe_type_info[pool->type];
|
struct rxe_type_info *info = &rxe_type_info[pool->type];
|
||||||
struct rb_node *node;
|
struct rb_node *node;
|
||||||
struct rxe_pool_entry *elem;
|
struct rxe_pool_entry *elem;
|
||||||
u8 *obj = NULL;
|
u8 *obj;
|
||||||
int cmp;
|
int cmp;
|
||||||
|
|
||||||
node = pool->key.tree.rb_node;
|
node = pool->key.tree.rb_node;
|
||||||
|
@ -469,7 +476,7 @@ void *rxe_pool_get_key_locked(struct rxe_pool *pool, void *key)
|
||||||
|
|
||||||
void *rxe_pool_get_key(struct rxe_pool *pool, void *key)
|
void *rxe_pool_get_key(struct rxe_pool *pool, void *key)
|
||||||
{
|
{
|
||||||
u8 *obj = NULL;
|
u8 *obj;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
read_lock_irqsave(&pool->pool_lock, flags);
|
read_lock_irqsave(&pool->pool_lock, flags);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче