summaryrefslogtreecommitdiffstats
path: root/include/rdma
diff options
context:
space:
mode:
authorMatan Barak <matanb@mellanox.com>2017-04-18 12:03:37 +0300
committerDoug Ledford <dledford@redhat.com>2017-04-20 11:44:07 -0400
commit30004b861afd99aebf34237373cb8ee9e890418e (patch)
treeb051c2685e1de34965724725ba9590cbd3ff0a90 /include/rdma
parentb58fc8049790ca780fb42bd2faabe9b921aedf44 (diff)
downloadlinux-30004b861afd99aebf34237373cb8ee9e890418e.tar.bz2
IB/core: Rename write flag to exclusive in rdma_core
We rename the "write" flags to "exclusive", as it's used for both WRITE and DESTROY actions. Fixes: 3832125624b7 ('IB/core: Add support for idr types') Signed-off-by: Matan Barak <matanb@mellanox.com> Reviewed-by: Sean Hefty <sean.hefty@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'include/rdma')
-rw-r--r--include/rdma/uverbs_types.h33
1 files changed, 17 insertions, 16 deletions
diff --git a/include/rdma/uverbs_types.h b/include/rdma/uverbs_types.h
index a37692167a45..351ea185df44 100644
--- a/include/rdma/uverbs_types.h
+++ b/include/rdma/uverbs_types.h
@@ -54,17 +54,18 @@ struct uverbs_obj_type_class {
* destroyed.
* [lookup]: Starts with lookup_get which fetches and locks the
* object. After the handler finished using the object, it
- * needs to call lookup_put to unlock it. The write flag
- * indicates if the object is locked for exclusive access.
- * [remove]: Starts with lookup_get with write flag set. This locks
- * the object for exclusive access. If the handler code
- * completed successfully, remove_commit is called and
- * the ib_uobject is removed from the context's uobjects
- * repository and put. The object itself is destroyed as
- * well. Once remove succeeds new krefs to the object
- * cannot be acquired by other threads or userspace and
- * the hardware driver is removed from the object.
- * Other krefs on the object may still exist.
+ * needs to call lookup_put to unlock it. The exclusive
+ * flag indicates if the object is locked for exclusive
+ * access.
+ * [remove]: Starts with lookup_get with exclusive flag set. This
+ * locks the object for exclusive access. If the handler
+ * code completed successfully, remove_commit is called
+ * and the ib_uobject is removed from the context's
+ * uobjects repository and put. The object itself is
+ * destroyed as well. Once remove succeeds new krefs to
+ * the object cannot be acquired by other threads or
+ * userspace and the hardware driver is removed from the
+ * object. Other krefs on the object may still exist.
* If the handler code failed, lookup_put should be
* called. This callback is used when the context
* is destroyed as well (process termination,
@@ -77,10 +78,10 @@ struct uverbs_obj_type_class {
struct ib_uobject *(*lookup_get)(const struct uverbs_obj_type *type,
struct ib_ucontext *ucontext, int id,
- bool write);
- void (*lookup_put)(struct ib_uobject *uobj, bool write);
+ bool exclusive);
+ void (*lookup_put)(struct ib_uobject *uobj, bool exclusive);
/*
- * Must be called with the write lock held. If successful uobj is
+ * Must be called with the exclusive lock held. If successful uobj is
* invalid on return. On failure uobject is left completely
* unchanged
*/
@@ -121,8 +122,8 @@ struct uverbs_obj_idr_type {
struct ib_uobject *rdma_lookup_get_uobject(const struct uverbs_obj_type *type,
struct ib_ucontext *ucontext,
- int id, bool write);
-void rdma_lookup_put_uobject(struct ib_uobject *uobj, bool write);
+ int id, bool exclusive);
+void rdma_lookup_put_uobject(struct ib_uobject *uobj, bool exclusive);
struct ib_uobject *rdma_alloc_begin_uobject(const struct uverbs_obj_type *type,
struct ib_ucontext *ucontext);
void rdma_alloc_abort_uobject(struct ib_uobject *uobj);