diff mbox series

[v3,3/5] IB/verbs: Add rdma_is_user_pd function

Message ID 20181031124242.24239-4-shamir.rabinovitch@oracle.com (mailing list archive)
State Superseded
Headers show
Series figure uverbs/kernel ib_pd w/o using ib_pd uobject | expand

Commit Message

Shamir Rabinovitch Oct. 31, 2018, 12:42 p.m. UTC
This function can replace the need for tests based on 'pd->uobject'
in the IB core code and will be used in next patches.

Signed-off-by: Shamir Rabinovitch <shamir.rabinovitch@oracle.com>
---
 include/rdma/ib_verbs.h | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index b17eea0..8f812e9 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -1550,6 +1550,11 @@  struct ib_pd {
 	struct rdma_restrack_entry res;
 };
 
+static inline bool rdma_is_user_pd(struct ib_pd *pd)
+{
+	return !rdma_is_kernel_res(&pd->res);
+}
+
 struct ib_xrcd {
 	struct ib_device       *device;
 	atomic_t		usecnt; /* count all exposed resources */