Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

IB: When attrs.udata/ufile is available use that instead of uobject

The ucontext and ufile should not be accessed via the uobject, all these
cases have an attrs so use that instead.

Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>

+9 -9
+3 -3
drivers/infiniband/core/rdma_core.c
··· 128 128 enum rdma_remove_reason reason, 129 129 struct uverbs_attr_bundle *attrs) 130 130 { 131 - struct ib_uverbs_file *ufile = uobj->ufile; 131 + struct ib_uverbs_file *ufile = attrs->ufile; 132 132 unsigned long flags; 133 133 int ret; 134 134 ··· 200 200 */ 201 201 int uobj_destroy(struct ib_uobject *uobj, struct uverbs_attr_bundle *attrs) 202 202 { 203 - struct ib_uverbs_file *ufile = uobj->ufile; 203 + struct ib_uverbs_file *ufile = attrs->ufile; 204 204 int ret; 205 205 206 206 down_read(&ufile->hw_destroy_rwsem); ··· 655 655 int __must_check rdma_alloc_commit_uobject(struct ib_uobject *uobj, 656 656 struct uverbs_attr_bundle *attrs) 657 657 { 658 - struct ib_uverbs_file *ufile = uobj->ufile; 658 + struct ib_uverbs_file *ufile = attrs->ufile; 659 659 int ret; 660 660 661 661 /* alloc_commit consumes the uobj kref */
+1 -1
drivers/infiniband/core/uverbs_std_types_counters.c
··· 54 54 { 55 55 struct ib_uobject *uobj = uverbs_attr_get_uobject( 56 56 attrs, UVERBS_ATTR_CREATE_COUNTERS_HANDLE); 57 - struct ib_device *ib_dev = uobj->context->device; 57 + struct ib_device *ib_dev = attrs->context->device; 58 58 struct ib_counters *counters; 59 59 int ret; 60 60
+1 -1
drivers/infiniband/core/uverbs_std_types_cq.c
··· 64 64 struct ib_ucq_object *obj = container_of( 65 65 uverbs_attr_get_uobject(attrs, UVERBS_ATTR_CREATE_CQ_HANDLE), 66 66 typeof(*obj), uobject); 67 - struct ib_device *ib_dev = obj->uobject.context->device; 67 + struct ib_device *ib_dev = attrs->context->device; 68 68 int ret; 69 69 u64 user_handle; 70 70 struct ib_cq_init_attr attr = {};
+2 -2
drivers/infiniband/core/uverbs_std_types_dm.c
··· 55 55 struct ib_uobject *uobj = 56 56 uverbs_attr_get(attrs, UVERBS_ATTR_ALLOC_DM_HANDLE) 57 57 ->obj_attr.uobject; 58 - struct ib_device *ib_dev = uobj->context->device; 58 + struct ib_device *ib_dev = attrs->context->device; 59 59 struct ib_dm *dm; 60 60 int ret; 61 61 ··· 72 72 if (ret) 73 73 return ret; 74 74 75 - dm = ib_dev->ops.alloc_dm(ib_dev, uobj->context, &attr, attrs); 75 + dm = ib_dev->ops.alloc_dm(ib_dev, attrs->context, &attr, attrs); 76 76 if (IS_ERR(dm)) 77 77 return PTR_ERR(dm); 78 78
+1 -1
drivers/infiniband/core/uverbs_std_types_flow_action.c
··· 310 310 { 311 311 struct ib_uobject *uobj = uverbs_attr_get_uobject( 312 312 attrs, UVERBS_ATTR_CREATE_FLOW_ACTION_ESP_HANDLE); 313 - struct ib_device *ib_dev = uobj->context->device; 313 + struct ib_device *ib_dev = attrs->context->device; 314 314 int ret; 315 315 struct ib_flow_action *action; 316 316 struct ib_flow_action_esp_attr esp_attr = {};
+1 -1
include/rdma/uverbs_std_types.h
··· 128 128 rdma_alloc_begin_uobject(obj, attrs->ufile, attrs); 129 129 130 130 if (!IS_ERR(uobj)) 131 - *ib_dev = uobj->context->device; 131 + *ib_dev = attrs->context->device; 132 132 return uobj; 133 133 } 134 134