From 13ef5539def732dc7b9c58c320d97a0a95b52634 Mon Sep 17 00:00:00 2001 From: Leon Romanovsky Date: Tue, 22 Sep 2020 12:11:04 +0300 Subject: RDMA/restrack: Count references to the verbs objects Refactor the restrack code to make sure the kref inside the restrack entry properly kref's the object in which it is embedded. This slight change is needed for future conversions of MR and QP which are refcounted before the release and kfree. The ideal flow from ib_core perspective as follows: * Allocate ib_* structure with rdma_zalloc_*. * Set everything that is known to ib_core to that newly created object. * Initialize kref with restrack help * Call to driver specific allocation functions. * Insert into restrack DB .... * Return and release restrack with restrack_put. Largely this means a rdma_restrack_new() should be called near allocating the containing structure. Link: https://lore.kernel.org/r/20200922091106.2152715-4-leon@kernel.org Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe --- include/rdma/restrack.h | 7 ------- 1 file changed, 7 deletions(-) (limited to 'include/rdma') diff --git a/include/rdma/restrack.h b/include/rdma/restrack.h index 7682d1bcf789..d7c166237939 100644 --- a/include/rdma/restrack.h +++ b/include/rdma/restrack.h @@ -110,13 +110,6 @@ int rdma_restrack_count(struct ib_device *dev, void rdma_restrack_kadd(struct rdma_restrack_entry *res); void rdma_restrack_uadd(struct rdma_restrack_entry *res); -/** - * rdma_restrack_del() - delete object from the reource tracking database - * @res: resource entry - * @type: actual type of object to operate - */ -void rdma_restrack_del(struct rdma_restrack_entry *res); - /** * rdma_is_kernel_res() - check the owner of resource * @res: resource entry -- cgit v1.2.3-59-g8ed1b