IB/uverbs: Consolidate uobject destruction
authorJason Gunthorpe <jgg@mellanox.com>
Thu, 26 Jul 2018 03:40:12 +0000 (21:40 -0600)
committerJason Gunthorpe <jgg@mellanox.com>
Wed, 1 Aug 2018 20:55:48 +0000 (14:55 -0600)
commit87ad80abc70d2d5a4e383bc7e63867c9bc660838
treeb45c48606a8240be4ecf6c8b971d0704a84fb290
parent32ed5c00ac5fdea49058fd49bf8707e101dc3dfe
IB/uverbs: Consolidate uobject destruction

There are several flows that can destroy a uobject and each one is
minimized and sprinkled throughout the code base, making it difficult to
understand and very hard to modify the destroy path.

Consolidate all of these into uverbs_destroy_uobject() and call it in all
cases where a uobject has to be destroyed.

This makes one change to the lifecycle, during any abort (eg when
alloc_commit is not called) we always call out to alloc_abort, even if
remove_commit needs to be called to delete a HW object.

This also renames RDMA_REMOVE_DURING_CLEANUP to RDMA_REMOVE_ABORT to
clarify its actual usage and revises some of the comments to reflect what
the life cycle is for the type implementation.

Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/core/rdma_core.c
include/rdma/ib_verbs.h
include/rdma/uverbs_types.h