summaryrefslogtreecommitdiffstats
path: root/include/rdma
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@mellanox.com>2018-07-04 11:32:08 +0300
committerJason Gunthorpe <jgg@mellanox.com>2018-07-09 11:26:17 -0600
commit6ef1c82821b2ae9bfa26fe65e6f0a66dfd79b7d7 (patch)
tree7025f260eec5f1fdb10baa1e24e27cd8052bcd19 /include/rdma
parent6a5e9c88419828a487204e35291ae4459697a9bd (diff)
downloadlinux-6ef1c82821b2ae9bfa26fe65e6f0a66dfd79b7d7.tar.bz2
IB/uverbs: Replace ib_ucontext with ib_uverbs_file in core function calls
The correct handle to refer to the idr/etc is ib_uverbs_file, revise all the core APIs to use this instead. The user API are left as wrappers that automatically convert a ucontext to a ufile for now. Signed-off-by: Jason Gunthorpe <jgg@mellanox.com> Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Diffstat (limited to 'include/rdma')
-rw-r--r--include/rdma/uverbs_std_types.h16
-rw-r--r--include/rdma/uverbs_types.h8
2 files changed, 12 insertions, 12 deletions
diff --git a/include/rdma/uverbs_std_types.h b/include/rdma/uverbs_std_types.h
index 27c24453fc12..13b92020edd0 100644
--- a/include/rdma/uverbs_std_types.h
+++ b/include/rdma/uverbs_std_types.h
@@ -48,28 +48,28 @@ static inline const struct uverbs_object_tree_def *uverbs_default_get_objects(vo
static inline struct ib_uobject *__uobj_get(const struct uverbs_obj_type *type,
bool write,
- struct ib_ucontext *ucontext,
+ struct ib_uverbs_file *ufile,
int id)
{
- return rdma_lookup_get_uobject(type, ucontext, id, write);
+ return rdma_lookup_get_uobject(type, ufile, id, write);
}
#define uobj_get_type(_object) UVERBS_OBJECT(_object).type_attrs
-#define uobj_get_read(_type, _id, _ucontext) \
- __uobj_get(uobj_get_type(_type), false, _ucontext, _id)
+#define uobj_get_read(_type, _id, _ucontext) \
+ __uobj_get(uobj_get_type(_type), false, (_ucontext)->ufile, _id)
#define uobj_get_obj_read(_object, _type, _id, _ucontext) \
({ \
struct ib_uobject *__uobj = \
__uobj_get(uobj_get_type(_type), \
- false, _ucontext, _id); \
+ false, (_ucontext)->ufile, _id); \
\
(struct ib_##_object *)(IS_ERR(__uobj) ? NULL : __uobj->object);\
})
-#define uobj_get_write(_type, _id, _ucontext) \
- __uobj_get(uobj_get_type(_type), true, _ucontext, _id)
+#define uobj_get_write(_type, _id, _ucontext) \
+ __uobj_get(uobj_get_type(_type), true, (_ucontext)->ufile, _id)
int __uobj_perform_destroy(const struct uverbs_obj_type *type, int id,
struct ib_uverbs_file *ufile, int success_res);
@@ -107,7 +107,7 @@ static inline void uobj_alloc_abort(struct ib_uobject *uobj)
static inline struct ib_uobject *__uobj_alloc(const struct uverbs_obj_type *type,
struct ib_ucontext *ucontext)
{
- return rdma_alloc_begin_uobject(type, ucontext);
+ return rdma_alloc_begin_uobject(type, ucontext->ufile);
}
#define uobj_alloc(_type, ucontext) \
diff --git a/include/rdma/uverbs_types.h b/include/rdma/uverbs_types.h
index 175495d1b0b8..5290d8d34e9a 100644
--- a/include/rdma/uverbs_types.h
+++ b/include/rdma/uverbs_types.h
@@ -72,12 +72,12 @@ struct uverbs_obj_type_class {
* reset flow).
*/
struct ib_uobject *(*alloc_begin)(const struct uverbs_obj_type *type,
- struct ib_ucontext *ucontext);
+ struct ib_uverbs_file *ufile);
void (*alloc_commit)(struct ib_uobject *uobj);
void (*alloc_abort)(struct ib_uobject *uobj);
struct ib_uobject *(*lookup_get)(const struct uverbs_obj_type *type,
- struct ib_ucontext *ucontext, int id,
+ struct ib_uverbs_file *ufile, int id,
bool exclusive);
void (*lookup_put)(struct ib_uobject *uobj, bool exclusive);
/*
@@ -120,11 +120,11 @@ struct uverbs_obj_idr_type {
};
struct ib_uobject *rdma_lookup_get_uobject(const struct uverbs_obj_type *type,
- struct ib_ucontext *ucontext,
+ struct ib_uverbs_file *ufile,
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);
+ struct ib_uverbs_file *ufile);
void rdma_alloc_abort_uobject(struct ib_uobject *uobj);
int __must_check rdma_remove_commit_uobject(struct ib_uobject *uobj);
int rdma_alloc_commit_uobject(struct ib_uobject *uobj);