diff options
author | Jason Gunthorpe <jgg@mellanox.com> | 2018-07-04 11:32:08 +0300 |
---|---|---|
committer | Jason Gunthorpe <jgg@mellanox.com> | 2018-07-09 11:26:17 -0600 |
commit | 6ef1c82821b2ae9bfa26fe65e6f0a66dfd79b7d7 (patch) | |
tree | 7025f260eec5f1fdb10baa1e24e27cd8052bcd19 /include/rdma/uverbs_std_types.h | |
parent | 6a5e9c88419828a487204e35291ae4459697a9bd (diff) |
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/uverbs_std_types.h')
-rw-r--r-- | include/rdma/uverbs_std_types.h | 16 |
1 files changed, 8 insertions, 8 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) \ |