Commit 321d7863 authored by Jason Gunthorpe's avatar Jason Gunthorpe

IB/uverbs: Delete type and id from uverbs_obj_attr

In this context the uobject is not allowed to be NULL, so type is the same
as uobject->type, and at least for IDR, id is the same as uobject->id.

FD objects should never handle the FD number outside the uAPI boundary
code.
Suggested-by: default avatarGuy Levi <guyle@mellanox.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
parent 4d7dff2b
...@@ -152,14 +152,12 @@ static int uverbs_process_attr(struct ib_device *ibdev, ...@@ -152,14 +152,12 @@ static int uverbs_process_attr(struct ib_device *ibdev,
object = uverbs_get_object(ibdev, spec->obj.obj_type); object = uverbs_get_object(ibdev, spec->obj.obj_type);
if (!object) if (!object)
return -EINVAL; return -EINVAL;
o_attr->type = object->type_attrs;
o_attr->id = (int)uattr->data;
o_attr->uobject = uverbs_get_uobject_from_context( o_attr->uobject = uverbs_get_uobject_from_context(
o_attr->type, object->type_attrs,
ucontext, ucontext,
spec->obj.access, spec->obj.access,
o_attr->id); (int)uattr->data);
if (IS_ERR(o_attr->uobject)) if (IS_ERR(o_attr->uobject))
return PTR_ERR(o_attr->uobject); return PTR_ERR(o_attr->uobject);
......
...@@ -344,11 +344,7 @@ struct uverbs_ptr_attr { ...@@ -344,11 +344,7 @@ struct uverbs_ptr_attr {
}; };
struct uverbs_obj_attr { struct uverbs_obj_attr {
/* pointer to the kernel descriptor -> type, access, etc */
const struct uverbs_obj_type *type;
struct ib_uobject *uobject; struct ib_uobject *uobject;
/* fd or id in idr of this object */
int id;
}; };
struct uverbs_attr { struct uverbs_attr {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment