summaryrefslogtreecommitdiffstats
path: root/include/rdma
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@mellanox.com>2018-07-04 11:32:09 +0300
committerJason Gunthorpe <jgg@mellanox.com>2018-07-09 11:26:17 -0600
commit2cc1e3b80942a7de7dce81f8a86c27a4ba3a695e (patch)
treed8b8acfa2ee2c9c8c0b2ba410f1834532222e468 /include/rdma
parent6ef1c82821b2ae9bfa26fe65e6f0a66dfd79b7d7 (diff)
downloadlinux-2cc1e3b80942a7de7dce81f8a86c27a4ba3a695e.tar.gz
linux-2cc1e3b80942a7de7dce81f8a86c27a4ba3a695e.tar.bz2
linux-2cc1e3b80942a7de7dce81f8a86c27a4ba3a695e.zip
IB/uverbs: Replace file->ucontext with file in uverbs_cmd.c
The ucontext isn't needed any more, just pass the uverbs_file directly. 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.h35
1 files changed, 19 insertions, 16 deletions
diff --git a/include/rdma/uverbs_std_types.h b/include/rdma/uverbs_std_types.h
index 13b92020edd0..3e3f108f0912 100644
--- a/include/rdma/uverbs_std_types.h
+++ b/include/rdma/uverbs_std_types.h
@@ -56,20 +56,24 @@ static inline struct ib_uobject *__uobj_get(const struct uverbs_obj_type *type,
#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)->ufile, _id)
+#define uobj_get_read(_type, _id, _ufile) \
+ __uobj_get(uobj_get_type(_type), false, _ufile, _id)
-#define uobj_get_obj_read(_object, _type, _id, _ucontext) \
-({ \
- struct ib_uobject *__uobj = \
- __uobj_get(uobj_get_type(_type), \
- false, (_ucontext)->ufile, _id); \
- \
- (struct ib_##_object *)(IS_ERR(__uobj) ? NULL : __uobj->object);\
-})
+static inline void *_uobj_get_obj_read(const struct uverbs_obj_type *type,
+ int id, struct ib_uverbs_file *ufile)
+{
+ struct ib_uobject *uobj = __uobj_get(type, false, ufile, id);
+
+ if (IS_ERR(uobj))
+ return NULL;
+ return uobj->object;
+}
+#define uobj_get_obj_read(_object, _type, _id, _ufile) \
+ ((struct ib_##_object *)_uobj_get_obj_read(uobj_get_type(_type), _id, \
+ _ufile))
-#define uobj_get_write(_type, _id, _ucontext) \
- __uobj_get(uobj_get_type(_type), true, (_ucontext)->ufile, _id)
+#define uobj_get_write(_type, _id, _ufile) \
+ __uobj_get(uobj_get_type(_type), true, _ufile, _id)
int __uobj_perform_destroy(const struct uverbs_obj_type *type, int id,
struct ib_uverbs_file *ufile, int success_res);
@@ -105,13 +109,12 @@ 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)
+ struct ib_uverbs_file *ufile)
{
- return rdma_alloc_begin_uobject(type, ucontext->ufile);
+ return rdma_alloc_begin_uobject(type, ufile);
}
-#define uobj_alloc(_type, ucontext) \
- __uobj_alloc(uobj_get_type(_type), ucontext)
+#define uobj_alloc(_type, _ufile) __uobj_alloc(uobj_get_type(_type), _ufile)
#endif