[PATCH v2 2/4] IB/verbs: Add rdma_is_user_pd function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 include/rdma/ib_verbs.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index 7ce617d77f8f..ad116c5e6675 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 */
-- 
2.17.1




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux