aboutsummaryrefslogtreecommitdiffstats
path: root/include/rdma/uverbs_types.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/rdma/uverbs_types.h')
-rw-r--r--include/rdma/uverbs_types.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/rdma/uverbs_types.h b/include/rdma/uverbs_types.h
index 0b0f5a5f392d..ca65d4704b4b 100644
--- a/include/rdma/uverbs_types.h
+++ b/include/rdma/uverbs_types.h
@@ -144,6 +144,18 @@ void rdma_alloc_abort_uobject(struct ib_uobject *uobj,
int __must_check rdma_alloc_commit_uobject(struct ib_uobject *uobj,
struct uverbs_attr_bundle *attrs);
+/*
+ * uverbs_uobject_get is called in order to increase the reference count on
+ * an uobject. This is useful when a handler wants to keep the uobject's memory
+ * alive, regardless if this uobject is still alive in the context's objects
+ * repository. Objects are put via uverbs_uobject_put.
+ */
+static inline void uverbs_uobject_get(struct ib_uobject *uobject)
+{
+ kref_get(&uobject->ref);
+}
+void uverbs_uobject_put(struct ib_uobject *uobject);
+
struct uverbs_obj_fd_type {
/*
* In fd based objects, uverbs_obj_type_ops points to generic