[PATCH] IB/uverbs: Delete type and id from uverbs_obj_attr

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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: Guy Levi <guyle@xxxxxxxxxxxx>
Signed-off-by: Jason Gunthorpe <jgg@xxxxxxxxxxxx>
---
 drivers/infiniband/core/uverbs_ioctl.c | 6 ++----
 include/rdma/uverbs_ioctl.h            | 4 ----
 2 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/infiniband/core/uverbs_ioctl.c b/drivers/infiniband/core/uverbs_ioctl.c
index 20be6835291e99..03065bad8dae8c 100644
--- a/drivers/infiniband/core/uverbs_ioctl.c
+++ b/drivers/infiniband/core/uverbs_ioctl.c
@@ -152,14 +152,12 @@ static int uverbs_process_attr(struct ib_device *ibdev,
 		object = uverbs_get_object(ibdev, spec->obj.obj_type);
 		if (!object)
 			return -EINVAL;
-		o_attr->type = object->type_attrs;
 
-		o_attr->id = (int)uattr->data;
 		o_attr->uobject = uverbs_get_uobject_from_context(
-					o_attr->type,
+					object->type_attrs,
 					ucontext,
 					spec->obj.access,
-					o_attr->id);
+					(int)uattr->data);
 
 		if (IS_ERR(o_attr->uobject))
 			return PTR_ERR(o_attr->uobject);
diff --git a/include/rdma/uverbs_ioctl.h b/include/rdma/uverbs_ioctl.h
index 970357d0ccc4b7..90a4947ff5480e 100644
--- a/include/rdma/uverbs_ioctl.h
+++ b/include/rdma/uverbs_ioctl.h
@@ -344,11 +344,7 @@ struct uverbs_ptr_attr {
 };
 
 struct uverbs_obj_attr {
-	/* pointer to the kernel descriptor -> type, access, etc */
-	const struct uverbs_obj_type	*type;
 	struct ib_uobject		*uobject;
-	/* fd or id in idr of this object */
-	int				id;
 };
 
 struct uverbs_attr {
-- 
2.17.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux