aboutsummaryrefslogtreecommitdiffstats
path: root/include/rdma/uverbs_types.h
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@mellanox.com>2018-07-25 21:40:13 -0600
committerJason Gunthorpe <jgg@mellanox.com>2018-08-01 14:55:48 -0600
commit9867f5c6695f0a17cde9a4dc140fe026b4e40d4a (patch)
tree0f3ae7da38924beecb4bc56b22bfda8abfad39dc /include/rdma/uverbs_types.h
parentIB/uverbs: Consolidate uobject destruction (diff)
downloadlinux-dev-9867f5c6695f0a17cde9a4dc140fe026b4e40d4a.tar.xz
linux-dev-9867f5c6695f0a17cde9a4dc140fe026b4e40d4a.zip
IB/uverbs: Convert 'bool exclusive' into an enum
This is more readable, and future patches will need a 3rd lookup type. Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'include/rdma/uverbs_types.h')
-rw-r--r--include/rdma/uverbs_types.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/include/rdma/uverbs_types.h b/include/rdma/uverbs_types.h
index 875dd8c16ba3..0676672dbbb9 100644
--- a/include/rdma/uverbs_types.h
+++ b/include/rdma/uverbs_types.h
@@ -38,6 +38,11 @@
struct uverbs_obj_type;
+enum rdma_lookup_mode {
+ UVERBS_LOOKUP_READ,
+ UVERBS_LOOKUP_WRITE,
+};
+
/*
* The following sequences are valid:
* Success flow:
@@ -78,8 +83,8 @@ struct uverbs_obj_type_class {
struct ib_uobject *(*lookup_get)(const struct uverbs_obj_type *type,
struct ib_uverbs_file *ufile, s64 id,
- bool exclusive);
- void (*lookup_put)(struct ib_uobject *uobj, bool exclusive);
+ enum rdma_lookup_mode mode);
+ void (*lookup_put)(struct ib_uobject *uobj, enum rdma_lookup_mode mode);
/* This does not consume the kref on uobj */
int __must_check (*remove_commit)(struct ib_uobject *uobj,
enum rdma_remove_reason why);
@@ -116,9 +121,10 @@ struct uverbs_obj_idr_type {
};
struct ib_uobject *rdma_lookup_get_uobject(const struct uverbs_obj_type *type,
- struct ib_uverbs_file *ufile,
- s64 id, bool exclusive);
-void rdma_lookup_put_uobject(struct ib_uobject *uobj, bool exclusive);
+ struct ib_uverbs_file *ufile, s64 id,
+ enum rdma_lookup_mode mode);
+void rdma_lookup_put_uobject(struct ib_uobject *uobj,
+ enum rdma_lookup_mode mode);
struct ib_uobject *rdma_alloc_begin_uobject(const struct uverbs_obj_type *type,
struct ib_uverbs_file *ufile);
void rdma_alloc_abort_uobject(struct ib_uobject *uobj);