/* This patch is related with following upstream kernel commit. blk_alloc_disk__no_present.cocci doesn't work for this patch. */ From 8b9ab62662048a3274361c7e5f64037c2c133e2c Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Sun, 19 Jun 2022 08:05:52 +0200 Subject: [PATCH] block: remove blk_cleanup_disk blk_cleanup_disk is nothing but a trivial wrapper for put_disk now, so remove it. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Link: https://lore.kernel.org/r/20220619060552.1850436-7-hch@lst.de Signed-off-by: Jens Axboe --- diff -Nupr a/drbd/drbd_main.c b/drbd/drbd_main.c --- a/drbd/drbd_main.c 2022-10-22 19:16:29.466820303 +0800 +++ b/drbd/drbd_main.c 2022-10-22 19:17:08.098772762 +0800 @@ -2928,7 +2928,7 @@ static void drbd_device_finalize_work_fn device->bitmap = NULL; } - blk_cleanup_disk(device->vdisk); + put_disk(device->vdisk); kfree(device); @@ -3810,7 +3810,7 @@ enum drbd_ret_code drbd_create_device(st return NO_ERROR; out_cleanup_disk: - blk_cleanup_disk(disk); + put_disk(disk); out_remove_peer_device: list_add_rcu(&tmp, &device->peer_devices); list_del_init(&device->peer_devices); @@ -3848,7 +3848,7 @@ out_no_peer_device: out_no_bitmap: __free_page(device->md_io.page); out_no_io_page: - blk_cleanup_disk(disk); + put_disk(disk); out_no_disk: kref_put(&resource->kref, drbd_destroy_resource); kref_debug_put(&resource->kref_debug, 4);