RDMA/core: Simplify restrack interface

In the current implementation, we have one restrack root per-device and
all users are simply providing it directly. Let's simplify the interface
and have callers provide the ib_device and internally access the
restrack_root.

Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
This commit is contained in:
Leon Romanovsky
2019-01-30 12:48:58 +02:00
committed by Jason Gunthorpe
parent 659067b0b5
commit 0ad699c0ed
4 changed files with 29 additions and 28 deletions

View File

@@ -49,6 +49,7 @@ enum rdma_restrack_type {
};
#define RDMA_RESTRACK_HASH_BITS 8
struct ib_device;
struct rdma_restrack_entry;
/**
@@ -122,25 +123,9 @@ struct rdma_restrack_entry {
bool user;
};
/**
* rdma_restrack_init() - initialize resource tracking
* @res: resource tracking root
*/
void rdma_restrack_init(struct rdma_restrack_root *res);
/**
* rdma_restrack_clean() - clean resource tracking
* @res: resource tracking root
*/
void rdma_restrack_clean(struct rdma_restrack_root *res);
/**
* rdma_restrack_count() - the current usage of specific object
* @res: resource entry
* @type: actual type of object to operate
* @ns: PID namespace
*/
int rdma_restrack_count(struct rdma_restrack_root *res,
void rdma_restrack_init(struct ib_device *dev);
void rdma_restrack_clean(struct ib_device *dev);
int rdma_restrack_count(struct ib_device *dev,
enum rdma_restrack_type type,
struct pid_namespace *ns);