aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core/uverbs_main.c
diff options
context:
space:
mode:
authorMatan Barak <matanb@mellanox.com>2017-04-04 13:31:43 +0300
committerDoug Ledford <dledford@redhat.com>2017-04-05 13:28:04 -0400
commit6be60aed126ccd4dfb4a60d1dc2ecec0bca21b2e (patch)
tree31764e2f00ed54dc264a7e71d1dd16830152b987 /drivers/infiniband/core/uverbs_main.c
parentIB/core: Add support for idr types (diff)
downloadlinux-dev-6be60aed126ccd4dfb4a60d1dc2ecec0bca21b2e.tar.xz
linux-dev-6be60aed126ccd4dfb4a60d1dc2ecec0bca21b2e.zip
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 <matanb@mellanox.com> Reviewed-by: Yishai Hadas <yishaih@mellanox.com> Reviewed-by: Sean Hefty <sean.hefty@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/core/uverbs_main.c')
-rw-r--r--drivers/infiniband/core/uverbs_main.c8
1 files changed, 5 insertions, 3 deletions
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);