mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
IB: Pass uverbs_attr_bundle down uobject destroy path
Pass uverbs_attr_bundle down the uobject destroy path. The next patch will use this to eliminate the dependecy of the drivers in ib_x->uobject pointers. Signed-off-by: Shamir Rabinovitch <shamir.rabinovitch@oracle.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
This commit is contained in:
committed by
Jason Gunthorpe
parent
70f06b26f0
commit
a6a3797df2
@@ -436,7 +436,7 @@ static int ib_uverbs_alloc_pd(struct uverbs_attr_bundle *attrs)
|
||||
if (ret)
|
||||
goto err_copy;
|
||||
|
||||
return uobj_alloc_commit(uobj);
|
||||
return uobj_alloc_commit(uobj, attrs);
|
||||
|
||||
err_copy:
|
||||
ib_dealloc_pd(pd);
|
||||
@@ -444,7 +444,7 @@ err_copy:
|
||||
err_alloc:
|
||||
kfree(pd);
|
||||
err:
|
||||
uobj_alloc_abort(uobj);
|
||||
uobj_alloc_abort(uobj, attrs);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -633,7 +633,7 @@ static int ib_uverbs_open_xrcd(struct uverbs_attr_bundle *attrs)
|
||||
|
||||
mutex_unlock(&ibudev->xrcd_tree_mutex);
|
||||
|
||||
return uobj_alloc_commit(&obj->uobject);
|
||||
return uobj_alloc_commit(&obj->uobject, attrs);
|
||||
|
||||
err_copy:
|
||||
if (inode) {
|
||||
@@ -646,7 +646,7 @@ err_dealloc_xrcd:
|
||||
ib_dealloc_xrcd(xrcd);
|
||||
|
||||
err:
|
||||
uobj_alloc_abort(&obj->uobject);
|
||||
uobj_alloc_abort(&obj->uobject, attrs);
|
||||
|
||||
err_tree_mutex_unlock:
|
||||
if (f.file)
|
||||
@@ -763,7 +763,7 @@ static int ib_uverbs_reg_mr(struct uverbs_attr_bundle *attrs)
|
||||
|
||||
uobj_put_obj_read(pd);
|
||||
|
||||
return uobj_alloc_commit(uobj);
|
||||
return uobj_alloc_commit(uobj, attrs);
|
||||
|
||||
err_copy:
|
||||
ib_dereg_mr(mr);
|
||||
@@ -772,7 +772,7 @@ err_put:
|
||||
uobj_put_obj_read(pd);
|
||||
|
||||
err_free:
|
||||
uobj_alloc_abort(uobj);
|
||||
uobj_alloc_abort(uobj, attrs);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -917,14 +917,14 @@ static int ib_uverbs_alloc_mw(struct uverbs_attr_bundle *attrs)
|
||||
goto err_copy;
|
||||
|
||||
uobj_put_obj_read(pd);
|
||||
return uobj_alloc_commit(uobj);
|
||||
return uobj_alloc_commit(uobj, attrs);
|
||||
|
||||
err_copy:
|
||||
uverbs_dealloc_mw(mw);
|
||||
err_put:
|
||||
uobj_put_obj_read(pd);
|
||||
err_free:
|
||||
uobj_alloc_abort(uobj);
|
||||
uobj_alloc_abort(uobj, attrs);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -965,11 +965,11 @@ static int ib_uverbs_create_comp_channel(struct uverbs_attr_bundle *attrs)
|
||||
|
||||
ret = uverbs_response(attrs, &resp, sizeof(resp));
|
||||
if (ret) {
|
||||
uobj_alloc_abort(uobj);
|
||||
uobj_alloc_abort(uobj, attrs);
|
||||
return ret;
|
||||
}
|
||||
|
||||
return uobj_alloc_commit(uobj);
|
||||
return uobj_alloc_commit(uobj, attrs);
|
||||
}
|
||||
|
||||
static struct ib_ucq_object *create_cq(struct uverbs_attr_bundle *attrs,
|
||||
@@ -1036,7 +1036,7 @@ static struct ib_ucq_object *create_cq(struct uverbs_attr_bundle *attrs,
|
||||
if (ret)
|
||||
goto err_cb;
|
||||
|
||||
ret = uobj_alloc_commit(&obj->uobject);
|
||||
ret = uobj_alloc_commit(&obj->uobject, attrs);
|
||||
if (ret)
|
||||
return ERR_PTR(ret);
|
||||
return obj;
|
||||
@@ -1049,7 +1049,7 @@ err_file:
|
||||
ib_uverbs_release_ucq(attrs->ufile, ev_file, obj);
|
||||
|
||||
err:
|
||||
uobj_alloc_abort(&obj->uobject);
|
||||
uobj_alloc_abort(&obj->uobject, attrs);
|
||||
|
||||
return ERR_PTR(ret);
|
||||
}
|
||||
@@ -1477,7 +1477,7 @@ static int create_qp(struct uverbs_attr_bundle *attrs,
|
||||
if (ind_tbl)
|
||||
uobj_put_obj_read(ind_tbl);
|
||||
|
||||
return uobj_alloc_commit(&obj->uevent.uobject);
|
||||
return uobj_alloc_commit(&obj->uevent.uobject, attrs);
|
||||
err_cb:
|
||||
ib_destroy_qp(qp);
|
||||
|
||||
@@ -1495,7 +1495,7 @@ err_put:
|
||||
if (ind_tbl)
|
||||
uobj_put_obj_read(ind_tbl);
|
||||
|
||||
uobj_alloc_abort(&obj->uevent.uobject);
|
||||
uobj_alloc_abort(&obj->uevent.uobject, attrs);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -1609,14 +1609,14 @@ static int ib_uverbs_open_qp(struct uverbs_attr_bundle *attrs)
|
||||
qp->uobject = &obj->uevent.uobject;
|
||||
uobj_put_read(xrcd_uobj);
|
||||
|
||||
return uobj_alloc_commit(&obj->uevent.uobject);
|
||||
return uobj_alloc_commit(&obj->uevent.uobject, attrs);
|
||||
|
||||
err_destroy:
|
||||
ib_destroy_qp(qp);
|
||||
err_xrcd:
|
||||
uobj_put_read(xrcd_uobj);
|
||||
err_put:
|
||||
uobj_alloc_abort(&obj->uevent.uobject);
|
||||
uobj_alloc_abort(&obj->uevent.uobject, attrs);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -2451,7 +2451,7 @@ static int ib_uverbs_create_ah(struct uverbs_attr_bundle *attrs)
|
||||
goto err_copy;
|
||||
|
||||
uobj_put_obj_read(pd);
|
||||
return uobj_alloc_commit(uobj);
|
||||
return uobj_alloc_commit(uobj, attrs);
|
||||
|
||||
err_copy:
|
||||
rdma_destroy_ah(ah, RDMA_DESTROY_AH_SLEEPABLE);
|
||||
@@ -2460,7 +2460,7 @@ err_put:
|
||||
uobj_put_obj_read(pd);
|
||||
|
||||
err:
|
||||
uobj_alloc_abort(uobj);
|
||||
uobj_alloc_abort(uobj, attrs);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -2962,7 +2962,7 @@ static int ib_uverbs_ex_create_wq(struct uverbs_attr_bundle *attrs)
|
||||
|
||||
uobj_put_obj_read(pd);
|
||||
uobj_put_obj_read(cq);
|
||||
return uobj_alloc_commit(&obj->uevent.uobject);
|
||||
return uobj_alloc_commit(&obj->uevent.uobject, attrs);
|
||||
|
||||
err_copy:
|
||||
ib_destroy_wq(wq);
|
||||
@@ -2971,7 +2971,7 @@ err_put_cq:
|
||||
err_put_pd:
|
||||
uobj_put_obj_read(pd);
|
||||
err_uobj:
|
||||
uobj_alloc_abort(&obj->uevent.uobject);
|
||||
uobj_alloc_abort(&obj->uevent.uobject, attrs);
|
||||
|
||||
return err;
|
||||
}
|
||||
@@ -3136,12 +3136,12 @@ static int ib_uverbs_ex_create_rwq_ind_table(struct uverbs_attr_bundle *attrs)
|
||||
for (j = 0; j < num_read_wqs; j++)
|
||||
uobj_put_obj_read(wqs[j]);
|
||||
|
||||
return uobj_alloc_commit(uobj);
|
||||
return uobj_alloc_commit(uobj, attrs);
|
||||
|
||||
err_copy:
|
||||
ib_destroy_rwq_ind_table(rwq_ind_tbl);
|
||||
err_uobj:
|
||||
uobj_alloc_abort(uobj);
|
||||
uobj_alloc_abort(uobj, attrs);
|
||||
put_wqs:
|
||||
for (j = 0; j < num_read_wqs; j++)
|
||||
uobj_put_obj_read(wqs[j]);
|
||||
@@ -3314,7 +3314,7 @@ static int ib_uverbs_ex_create_flow(struct uverbs_attr_bundle *attrs)
|
||||
kfree(flow_attr);
|
||||
if (cmd.flow_attr.num_of_specs)
|
||||
kfree(kern_flow_attr);
|
||||
return uobj_alloc_commit(uobj);
|
||||
return uobj_alloc_commit(uobj, attrs);
|
||||
err_copy:
|
||||
if (!qp->device->ops.destroy_flow(flow_id))
|
||||
atomic_dec(&qp->usecnt);
|
||||
@@ -3325,7 +3325,7 @@ err_free_flow_attr:
|
||||
err_put:
|
||||
uobj_put_obj_read(qp);
|
||||
err_uobj:
|
||||
uobj_alloc_abort(uobj);
|
||||
uobj_alloc_abort(uobj, attrs);
|
||||
err_free_attr:
|
||||
if (cmd.flow_attr.num_of_specs)
|
||||
kfree(kern_flow_attr);
|
||||
@@ -3458,7 +3458,7 @@ static int __uverbs_create_xsrq(struct uverbs_attr_bundle *attrs,
|
||||
uobj_put_obj_read(attr.ext.cq);
|
||||
|
||||
uobj_put_obj_read(pd);
|
||||
return uobj_alloc_commit(&obj->uevent.uobject);
|
||||
return uobj_alloc_commit(&obj->uevent.uobject, attrs);
|
||||
|
||||
err_copy:
|
||||
ib_destroy_srq(srq);
|
||||
@@ -3477,7 +3477,7 @@ err_put_xrcd:
|
||||
}
|
||||
|
||||
err:
|
||||
uobj_alloc_abort(&obj->uevent.uobject);
|
||||
uobj_alloc_abort(&obj->uevent.uobject, attrs);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user