aboutsummaryrefslogtreecommitdiffstats
path: root/include/rdma/uverbs_std_types.h
diff options
context:
space:
mode:
authorShamir Rabinovitch <shamir.rabinovitch@oracle.com>2019-02-07 18:44:47 +0200
committerJason Gunthorpe <jgg@mellanox.com>2019-02-15 11:16:21 -0700
commit3d9dfd060391928bd615db62ecddea5e1255edfd (patch)
tree0784bbace18b2640ac0da56097b90e8a3f7eedf6 /include/rdma/uverbs_std_types.h
parentIB/ipoib: Use __func__ instead of function's name (diff)
downloadlinux-dev-3d9dfd060391928bd615db62ecddea5e1255edfd.tar.xz
linux-dev-3d9dfd060391928bd615db62ecddea5e1255edfd.zip
IB/uverbs: Add ib_ucontext to uverbs_attr_bundle sent from ioctl and cmd flows
Add ib_ucontext to the uverbs_attr_bundle sent down the iocl and cmd flows as soon as the flow has ib_uobject. In addition, remove rdma_get_ucontext helper function that is only used by ib_umem_get. Signed-off-by: Shamir Rabinovitch <shamir.rabinovitch@oracle.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'include/rdma/uverbs_std_types.h')
-rw-r--r--include/rdma/uverbs_std_types.h18
1 files changed, 13 insertions, 5 deletions
diff --git a/include/rdma/uverbs_std_types.h b/include/rdma/uverbs_std_types.h
index 883abcf6d36e..794c47565971 100644
--- a/include/rdma/uverbs_std_types.h
+++ b/include/rdma/uverbs_std_types.h
@@ -48,9 +48,12 @@
#define uobj_get_type(_attrs, _object) \
uapi_get_object((_attrs)->ufile->device->uapi, _object)
+struct ib_uobject *_uobj_get_read(enum uverbs_default_objects type,
+ u32 object_id,
+ struct uverbs_attr_bundle *attrs);
+
#define uobj_get_read(_type, _id, _attrs) \
- rdma_lookup_get_uobject(uobj_get_type(_attrs, _type), (_attrs)->ufile, \
- _uobj_check_id(_id), UVERBS_LOOKUP_READ)
+ _uobj_get_read(_type, _uobj_check_id(_id), _attrs)
#define ufd_get_read(_type, _fdnum, _attrs) \
rdma_lookup_get_uobject(uobj_get_type(_attrs, _type), (_attrs)->ufile, \
@@ -67,9 +70,12 @@ static inline void *_uobj_get_obj_read(struct ib_uobject *uobj)
((struct ib_##_object *)_uobj_get_obj_read( \
uobj_get_read(_type, _id, _attrs)))
+struct ib_uobject *_uobj_get_write(enum uverbs_default_objects type,
+ u32 object_id,
+ struct uverbs_attr_bundle *attrs);
+
#define uobj_get_write(_type, _id, _attrs) \
- rdma_lookup_get_uobject(uobj_get_type(_attrs, _type), (_attrs)->ufile, \
- _uobj_check_id(_id), UVERBS_LOOKUP_WRITE)
+ _uobj_get_write(_type, _uobj_check_id(_id), _attrs)
int __uobj_perform_destroy(const struct uverbs_api_object *obj, u32 id,
const struct uverbs_attr_bundle *attrs);
@@ -123,8 +129,10 @@ __uobj_alloc(const struct uverbs_api_object *obj,
{
struct ib_uobject *uobj = rdma_alloc_begin_uobject(obj, attrs->ufile);
- if (!IS_ERR(uobj))
+ if (!IS_ERR(uobj)) {
*ib_dev = uobj->context->device;
+ attrs->context = uobj->context;
+ }
return uobj;
}