summaryrefslogtreecommitdiffstats
path: root/include/rdma
diff options
context:
space:
mode:
authorLeon Romanovsky <leonro@mellanox.com>2019-01-30 12:48:58 +0200
committerJason Gunthorpe <jgg@mellanox.com>2019-01-30 21:15:47 -0700
commit0ad699c0edc97a864177679dd67f2ccd73b07cb7 (patch)
tree6c089d7e15abb819b26d60543ddf752794c39395 /include/rdma
parent659067b0b5c36efa02ebae5e30d09d9303039029 (diff)
downloadlinux-0ad699c0edc97a864177679dd67f2ccd73b07cb7.tar.bz2
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>
Diffstat (limited to 'include/rdma')
-rw-r--r--include/rdma/restrack.h23
1 files changed, 4 insertions, 19 deletions
diff --git a/include/rdma/restrack.h b/include/rdma/restrack.h
index 8f179be9d9a9..f756fc48eee5 100644
--- a/include/rdma/restrack.h
+++ b/include/rdma/restrack.h
@@ -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);