mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-29 23:24:11 +08:00
7c77c6a9bf
As a preparation to extension of rdma_restrack_root to provide software IDs, which will be per-type too. We convert the rdma_restrack_root from struct with arrays to array of structs. Such conversion allows us to drop rwsem lock in favour of internal XArray lock. Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
29 lines
647 B
C
29 lines
647 B
C
/* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
|
|
/*
|
|
* Copyright (c) 2017-2019 Mellanox Technologies. All rights reserved.
|
|
*/
|
|
|
|
#ifndef _RDMA_CORE_RESTRACK_H_
|
|
#define _RDMA_CORE_RESTRACK_H_
|
|
|
|
#include <linux/mutex.h>
|
|
|
|
/**
|
|
* struct rdma_restrack_root - main resource tracking management
|
|
* entity, per-device
|
|
*/
|
|
struct rdma_restrack_root {
|
|
/**
|
|
* @xa: Array of XArray structure to hold restrack entries.
|
|
*/
|
|
struct xarray xa;
|
|
/**
|
|
* @next_id: Next ID to support cyclic allocation
|
|
*/
|
|
u32 next_id;
|
|
};
|
|
|
|
int rdma_restrack_init(struct ib_device *dev);
|
|
void rdma_restrack_clean(struct ib_device *dev);
|
|
#endif /* _RDMA_CORE_RESTRACK_H_ */
|