From 6be60aed126ccd4dfb4a60d1dc2ecec0bca21b2e Mon Sep 17 00:00:00 2001 From: Matan Barak Date: Tue, 4 Apr 2017 13:31:43 +0300 Subject: IB/core: Add idr based standard types This patch adds the standard idr based types. These types are used in downstream patches in order to initialize, destroy and lookup IB standard objects which are based on idr objects. An idr object requires filling out several parameters. Its op pointer should point to uverbs_idr_ops and its size should be at least the size of ib_uobject. We add a macro to make the type declaration easier. Signed-off-by: Matan Barak Reviewed-by: Yishai Hadas Reviewed-by: Sean Hefty Signed-off-by: Doug Ledford --- drivers/infiniband/core/uverbs_main.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'drivers/infiniband/core/uverbs_main.c') diff --git a/drivers/infiniband/core/uverbs_main.c b/drivers/infiniband/core/uverbs_main.c index f6812fb6cd0c..e1db6782d0d4 100644 --- a/drivers/infiniband/core/uverbs_main.c +++ b/drivers/infiniband/core/uverbs_main.c @@ -201,8 +201,8 @@ void ib_uverbs_release_uevent(struct ib_uverbs_file *file, spin_unlock_irq(&file->async_file->lock); } -static void ib_uverbs_detach_umcast(struct ib_qp *qp, - struct ib_uqp_object *uobj) +void ib_uverbs_detach_umcast(struct ib_qp *qp, + struct ib_uqp_object *uobj) { struct ib_uverbs_mcast_entry *mcast, *tmp; @@ -331,7 +331,9 @@ static int ib_uverbs_cleanup_ucontext(struct ib_uverbs_file *file, container_of(uobj, struct ib_uxrcd_object, uobject); idr_remove_uobj(uobj); - ib_uverbs_dealloc_xrcd(file->device, xrcd); + ib_uverbs_dealloc_xrcd(file->device, xrcd, + file->ucontext ? RDMA_REMOVE_CLOSE : + RDMA_REMOVE_DRIVER_REMOVE); kfree(uxrcd); } mutex_unlock(&file->device->xrcd_tree_mutex); -- cgit v1.2.3