Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit feec576a authored by Jason Gunthorpe's avatar Jason Gunthorpe
Browse files

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: default avatarJason Gunthorpe <jgg@mellanox.com>
parent e79c9c60
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -128,7 +128,7 @@ static int uverbs_destroy_uobject(struct ib_uobject *uobj,
				  enum rdma_remove_reason reason,
				  struct uverbs_attr_bundle *attrs)
{
	struct ib_uverbs_file *ufile = uobj->ufile;
	struct ib_uverbs_file *ufile = attrs->ufile;
	unsigned long flags;
	int ret;

@@ -200,7 +200,7 @@ static int uverbs_destroy_uobject(struct ib_uobject *uobj,
 */
int uobj_destroy(struct ib_uobject *uobj, struct uverbs_attr_bundle *attrs)
{
	struct ib_uverbs_file *ufile = uobj->ufile;
	struct ib_uverbs_file *ufile = attrs->ufile;
	int ret;

	down_read(&ufile->hw_destroy_rwsem);
@@ -655,7 +655,7 @@ static int alloc_commit_fd_uobject(struct ib_uobject *uobj)
int __must_check rdma_alloc_commit_uobject(struct ib_uobject *uobj,
					   struct uverbs_attr_bundle *attrs)
{
	struct ib_uverbs_file *ufile = uobj->ufile;
	struct ib_uverbs_file *ufile = attrs->ufile;
	int ret;

	/* alloc_commit consumes the uobj kref */
+1 −1
Original line number Diff line number Diff line
@@ -54,7 +54,7 @@ static int UVERBS_HANDLER(UVERBS_METHOD_COUNTERS_CREATE)(
{
	struct ib_uobject *uobj = uverbs_attr_get_uobject(
		attrs, UVERBS_ATTR_CREATE_COUNTERS_HANDLE);
	struct ib_device *ib_dev = uobj->context->device;
	struct ib_device *ib_dev = attrs->context->device;
	struct ib_counters *counters;
	int ret;

+1 −1
Original line number Diff line number Diff line
@@ -64,7 +64,7 @@ static int UVERBS_HANDLER(UVERBS_METHOD_CQ_CREATE)(
	struct ib_ucq_object *obj = container_of(
		uverbs_attr_get_uobject(attrs, UVERBS_ATTR_CREATE_CQ_HANDLE),
		typeof(*obj), uobject);
	struct ib_device *ib_dev = obj->uobject.context->device;
	struct ib_device *ib_dev = attrs->context->device;
	int ret;
	u64 user_handle;
	struct ib_cq_init_attr attr = {};
+2 −2
Original line number Diff line number Diff line
@@ -55,7 +55,7 @@ static int UVERBS_HANDLER(UVERBS_METHOD_DM_ALLOC)(
	struct ib_uobject *uobj =
		uverbs_attr_get(attrs, UVERBS_ATTR_ALLOC_DM_HANDLE)
			->obj_attr.uobject;
	struct ib_device *ib_dev = uobj->context->device;
	struct ib_device *ib_dev = attrs->context->device;
	struct ib_dm *dm;
	int ret;

@@ -72,7 +72,7 @@ static int UVERBS_HANDLER(UVERBS_METHOD_DM_ALLOC)(
	if (ret)
		return ret;

	dm = ib_dev->ops.alloc_dm(ib_dev, uobj->context, &attr, attrs);
	dm = ib_dev->ops.alloc_dm(ib_dev, attrs->context, &attr, attrs);
	if (IS_ERR(dm))
		return PTR_ERR(dm);

+1 −1
Original line number Diff line number Diff line
@@ -310,7 +310,7 @@ static int UVERBS_HANDLER(UVERBS_METHOD_FLOW_ACTION_ESP_CREATE)(
{
	struct ib_uobject *uobj = uverbs_attr_get_uobject(
		attrs, UVERBS_ATTR_CREATE_FLOW_ACTION_ESP_HANDLE);
	struct ib_device *ib_dev = uobj->context->device;
	struct ib_device *ib_dev = attrs->context->device;
	int				  ret;
	struct ib_flow_action		  *action;
	struct ib_flow_action_esp_attr	  esp_attr = {};
Loading