]> git.baikalelectronics.ru Git - kernel.git/commitdiff
block: remove blk_cleanup_disk
authorChristoph Hellwig <hch@lst.de>
Sun, 19 Jun 2022 06:05:52 +0000 (08:05 +0200)
committerJens Axboe <axboe@kernel.dk>
Tue, 28 Jun 2022 12:33:15 +0000 (06:33 -0600)
blk_cleanup_disk is nothing but a trivial wrapper for put_disk now,
so remove it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Link: https://lore.kernel.org/r/20220619060552.1850436-7-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
47 files changed:
arch/m68k/emu/nfblock.c
arch/um/drivers/ubd_kern.c
arch/xtensa/platforms/iss/simdisk.c
block/genhd.c
drivers/block/amiflop.c
drivers/block/aoe/aoeblk.c
drivers/block/aoe/aoedev.c
drivers/block/ataflop.c
drivers/block/brd.c
drivers/block/drbd/drbd_main.c
drivers/block/floppy.c
drivers/block/loop.c
drivers/block/mtip32xx/mtip32xx.c
drivers/block/n64cart.c
drivers/block/nbd.c
drivers/block/null_blk/main.c
drivers/block/paride/pcd.c
drivers/block/paride/pd.c
drivers/block/paride/pf.c
drivers/block/pktcdvd.c
drivers/block/ps3disk.c
drivers/block/ps3vram.c
drivers/block/rbd.c
drivers/block/rnbd/rnbd-clt.c
drivers/block/sunvdc.c
drivers/block/swim.c
drivers/block/swim3.c
drivers/block/sx8.c
drivers/block/virtio_blk.c
drivers/block/xen-blkfront.c
drivers/block/z2ram.c
drivers/block/zram/zram_drv.c
drivers/cdrom/gdrom.c
drivers/md/bcache/super.c
drivers/md/dm.c
drivers/md/md.c
drivers/memstick/core/ms_block.c
drivers/memstick/core/mspro_block.c
drivers/mtd/mtd_blkdevs.c
drivers/mtd/ubi/block.c
drivers/nvdimm/btt.c
drivers/nvdimm/pmem.c
drivers/nvme/host/core.c
drivers/nvme/host/multipath.c
drivers/s390/block/dcssblk.c
drivers/s390/block/scm_blk.c
include/linux/blkdev.h

index 267b02cc5655b698dd4d3c8a749879b95c178d95..a708fbd5a844f8a2c6a60cea6eb2e5a126e8dbdb 100644 (file)
@@ -138,7 +138,7 @@ static int __init nfhd_init_one(int id, u32 blocks, u32 bsize)
        return 0;
 
 out_cleanup_disk:
-       blk_cleanup_disk(dev->disk);
+       put_disk(dev->disk);
 free_dev:
        kfree(dev);
 out:
@@ -180,7 +180,7 @@ static void __exit nfhd_exit(void)
        list_for_each_entry_safe(dev, next, &nfhd_list, list) {
                list_del(&dev->list);
                del_gendisk(dev->disk);
-               blk_cleanup_disk(dev->disk);
+               put_disk(dev->disk);
                kfree(dev);
        }
        unregister_blkdev(major_num, "nfhd");
index c4344b67628dd677a4bd952d2aa8e783ccc56b39..479b79e114424c488c7ed546340f0b001cc0449d 100644 (file)
@@ -925,7 +925,7 @@ static int ubd_add(int n, char **error_out)
        return 0;
 
 out_cleanup_disk:
-       blk_cleanup_disk(disk);
+       put_disk(disk);
 out_cleanup_tags:
        blk_mq_free_tag_set(&ubd_dev->tag_set);
 out:
@@ -1032,7 +1032,7 @@ static int ubd_remove(int n, char **error_out)
        ubd_gendisk[n] = NULL;
        if(disk != NULL){
                del_gendisk(disk);
-               blk_cleanup_disk(disk);
+               put_disk(disk);
        }
 
        err = 0;
index 4255b92fa3eb0b9e8dd03be87476f96624601771..f50caaa1c2496e86fdc85a0f74d55813aec13ad2 100644 (file)
@@ -290,7 +290,7 @@ static int __init simdisk_setup(struct simdisk *dev, int which,
        return 0;
 
 out_cleanup_disk:
-       blk_cleanup_disk(dev->gd);
+       put_disk(dev->gd);
 out:
        return err;
 }
@@ -344,7 +344,7 @@ static void simdisk_teardown(struct simdisk *dev, int which,
        simdisk_detach(dev);
        if (dev->gd) {
                del_gendisk(dev->gd);
-               blk_cleanup_disk(dev->gd);
+               put_disk(dev->gd);
        }
        remove_proc_entry(tmp, procdir);
 }
index 4d15f828c44988dd652af5ae4d37ed58946fd03f..bf9be06af2c8da3175865cd5bd15e291124bb699 100644 (file)
@@ -1432,21 +1432,6 @@ void put_disk(struct gendisk *disk)
 }
 EXPORT_SYMBOL(put_disk);
 
-/**
- * blk_cleanup_disk - shutdown a gendisk allocated by blk_alloc_disk
- * @disk: gendisk to shutdown
- *
- * Mark the queue hanging off @disk DYING, drain all pending requests, then mark
- * the queue DEAD, destroy and put it and the gendisk structure.
- *
- * Context: can sleep
- */
-void blk_cleanup_disk(struct gendisk *disk)
-{
-       put_disk(disk);
-}
-EXPORT_SYMBOL(blk_cleanup_disk);
-
 static void set_disk_ro_uevent(struct gendisk *gd, int ro)
 {
        char event[] = "DISK_RO=1";
index 5a566f2fd533a7d1a2c5f85fd84c41358e1461e8..4c8b2ba579ee6d8916f8c0299f45f3c64ff7fb10 100644 (file)
@@ -1802,7 +1802,7 @@ static int fd_alloc_disk(int drive, int system)
        unit[drive].gendisk[system] = disk;
        err = add_disk(disk);
        if (err)
-               blk_cleanup_disk(disk);
+               put_disk(disk);
        return err;
 }
 
index 348adf3352177d7644489bfe973ea94d22a2f96f..12b3ca8f6f4a91277c76f9f357e291b78987c5b6 100644 (file)
@@ -427,7 +427,7 @@ aoeblk_gdalloc(void *vp)
        return;
 
 out_disk_cleanup:
-       blk_cleanup_disk(gd);
+       put_disk(gd);
 err_tagset:
        blk_mq_free_tag_set(set);
 err_mempool:
index b381d1c3ef327502b9eece7bd37127d12152fd30..3523dd82d7a002b217f2f4856e9f42daeba13caa 100644 (file)
@@ -277,7 +277,7 @@ freedev(struct aoedev *d)
        if (d->gd) {
                aoedisk_rm_debugfs(d);
                del_gendisk(d->gd);
-               blk_cleanup_disk(d->gd);
+               put_disk(d->gd);
                blk_mq_free_tag_set(&d->tag_set);
        }
        t = d->targets;
index c6e41ee18aaa28833862e5412c6e1c9d2d5300b3..9deb4df6bdb8b2cd58261a6bc899281fd539db7c 100644 (file)
@@ -2031,7 +2031,7 @@ static void ataflop_probe(dev_t dev)
        return;
 
 cleanup_disk:
-       blk_cleanup_disk(unit[drive].disk[type]);
+       put_disk(unit[drive].disk[type]);
        unit[drive].disk[type] = NULL;
 }
 
@@ -2063,7 +2063,7 @@ static void atari_cleanup_floppy_disk(struct atari_floppy_struct *fs)
                        continue;
                if (fs->registered[type])
                        del_gendisk(fs->disk[type]);
-               blk_cleanup_disk(fs->disk[type]);
+               put_disk(fs->disk[type]);
        }
        blk_mq_free_tag_set(&fs->tag_set);
 }
index 6e3f2f0d235209c6994ef67fc7dc45aadaad3e1b..9e26d5e769f321ffcb8555651d6fa4cf249c43f8 100644 (file)
@@ -419,7 +419,7 @@ static int brd_alloc(int i)
        return 0;
 
 out_cleanup_disk:
-       blk_cleanup_disk(disk);
+       put_disk(disk);
 out_free_dev:
        list_del(&brd->brd_list);
        kfree(brd);
@@ -439,7 +439,7 @@ static void brd_cleanup(void)
 
        list_for_each_entry_safe(brd, next, &brd_devices, brd_list) {
                del_gendisk(brd->brd_disk);
-               blk_cleanup_disk(brd->brd_disk);
+               put_disk(brd->brd_disk);
                brd_free_pages(brd);
                list_del(&brd->brd_list);
                kfree(brd);
index 2887350ae010a78c5c5949c2a61af2eb746ed1d2..f3e4db16fd07bb6044b0b211203fafb18d1327ee 100644 (file)
@@ -2207,7 +2207,7 @@ void drbd_destroy_device(struct kref *kref)
        if (device->bitmap) /* should no longer be there. */
                drbd_bm_cleanup(device);
        __free_page(device->md_io.page);
-       blk_cleanup_disk(device->vdisk);
+       put_disk(device->vdisk);
        kfree(device->rs_plan_s);
 
        /* not for_each_connection(connection, resource):
@@ -2807,7 +2807,7 @@ out_no_minor_idr:
 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);
        kfree(device);
index 015841f50f4e994830836f41f02b106b25db18cc..491e7205a0db075f5136ec269d0ab70232e19882 100644 (file)
@@ -4557,7 +4557,7 @@ out:
        return;
 
 cleanup_disk:
-       blk_cleanup_disk(disks[drive][type]);
+       put_disk(disks[drive][type]);
        disks[drive][type] = NULL;
        mutex_unlock(&floppy_probe_lock);
 }
@@ -4753,7 +4753,7 @@ out_put_disk:
                if (!disks[drive][0])
                        break;
                del_timer_sync(&motor_off_timer[drive]);
-               blk_cleanup_disk(disks[drive][0]);
+               put_disk(disks[drive][0]);
                blk_mq_free_tag_set(&tag_sets[drive]);
        }
        return err;
@@ -4985,7 +4985,7 @@ static void __exit floppy_module_exit(void)
                }
                for (i = 0; i < ARRAY_SIZE(floppy_type); i++) {
                        if (disks[drive][i])
-                               blk_cleanup_disk(disks[drive][i]);
+                               put_disk(disks[drive][i]);
                }
                blk_mq_free_tag_set(&tag_sets[drive]);
        }
index cc608226c8c78c29fb93523e43ce9a60c24d66ad..e3c0ba93c1a34cd4969d5e9235ded7382b11d113 100644 (file)
@@ -2040,7 +2040,7 @@ static int loop_add(int i)
        return i;
 
 out_cleanup_disk:
-       blk_cleanup_disk(disk);
+       put_disk(disk);
 out_cleanup_tags:
        blk_mq_free_tag_set(&lo->tag_set);
 out_free_idr:
index 1d0e0a9fdd7c2005f656230c25efa6b701ff5f03..e116c6cf56f5fdcdae042e0da38f1fdab9dd663b 100644 (file)
@@ -3534,7 +3534,7 @@ init_hw_cmds_error:
 disk_index_error:
        ida_free(&rssd_index_ida, index);
 ida_get_error:
-       blk_cleanup_disk(dd->disk);
+       put_disk(dd->disk);
 block_queue_alloc_init_error:
        blk_mq_free_tag_set(&dd->tags);
 block_queue_alloc_tag_error:
index e094d2b8b5a929804d12a3f7be58b97ca5ca13a2..d914156db2d8b2d698432001ecc6534f619b7394 100644 (file)
@@ -157,7 +157,7 @@ static int __init n64cart_probe(struct platform_device *pdev)
        return 0;
 
 out_cleanup_disk:
-       blk_cleanup_disk(disk);
+       put_disk(disk);
 out:
        return err;
 }
index 07f3c139a3d773a9100947551f0ed5733fd5adec..5c4c9c45c6ace1f4abb297e4c66db95e409e3b90 100644 (file)
@@ -250,7 +250,7 @@ static void nbd_dev_remove(struct nbd_device *nbd)
        struct gendisk *disk = nbd->disk;
 
        del_gendisk(disk);
-       blk_cleanup_disk(disk);
+       put_disk(disk);
        blk_mq_free_tag_set(&nbd->tag_set);
 
        /*
@@ -1833,7 +1833,7 @@ static struct nbd_device *nbd_dev_add(int index, unsigned int refs)
 out_free_work:
        destroy_workqueue(nbd->recv_workq);
 out_err_disk:
-       blk_cleanup_disk(disk);
+       put_disk(disk);
 out_free_idr:
        mutex_lock(&nbd_index_mutex);
        idr_remove(&nbd_index_idr, index);
index 6b67088f4ea71c759f0e2ff0ece7dc8ab408368a..d695ea29efa6db5239413b66e28a16066e811a77 100644 (file)
@@ -1737,7 +1737,7 @@ static void null_del_dev(struct nullb *nullb)
                null_restart_queue_async(nullb);
        }
 
-       blk_cleanup_disk(nullb->disk);
+       put_disk(nullb->disk);
        if (dev->queue_mode == NULL_Q_MQ &&
            nullb->tag_set == &nullb->__tag_set)
                blk_mq_free_tag_set(nullb->tag_set);
@@ -2082,7 +2082,7 @@ static int null_add_dev(struct nullb_device *dev)
 out_cleanup_zone:
        null_free_zoned_dev(dev);
 out_cleanup_disk:
-       blk_cleanup_disk(nullb->disk);
+       put_disk(nullb->disk);
 out_cleanup_tags:
        if (dev->queue_mode == NULL_Q_MQ && nullb->tag_set == &nullb->__tag_set)
                blk_mq_free_tag_set(nullb->tag_set);
index f462ad67931aa9a5eafec8ac2ec25b4f4bdb0e80..a5ab407841193ef2641d57e8de9745614cd21284 100644 (file)
@@ -956,7 +956,7 @@ out_unreg_cdrom:
 out_pi_release:
        pi_release(cd->pi);
 out_free_disk:
-       blk_cleanup_disk(cd->disk);
+       put_disk(cd->disk);
 out_free_tag_set:
        blk_mq_free_tag_set(&cd->tag_set);
        return ret;
@@ -1029,7 +1029,7 @@ static void __exit pcd_exit(void)
                unregister_cdrom(&cd->info);
                del_gendisk(cd->disk);
                pi_release(cd->pi);
-               blk_cleanup_disk(cd->disk);
+               put_disk(cd->disk);
 
                blk_mq_free_tag_set(&cd->tag_set);
        }
index 3637c38c72f978b453377d24a1288d15808a45ea..c8c14c6f5c3a273ec91f31fb8122d317882697f9 100644 (file)
@@ -943,7 +943,7 @@ static int pd_probe_drive(struct pd_unit *disk, int autoprobe, int port,
                goto cleanup_disk;
        return 0;
 cleanup_disk:
-       blk_cleanup_disk(disk->gd);
+       put_disk(disk->gd);
 put_disk:
        put_disk(p);
        disk->gd = NULL;
@@ -1018,7 +1018,7 @@ static void __exit pd_exit(void)
                if (p) {
                        disk->gd = NULL;
                        del_gendisk(p);
-                       blk_cleanup_disk(p);
+                       put_disk(p);
                        blk_mq_free_tag_set(&disk->tag_set);
                        pi_release(disk->pi);
                }
index 292e9a4ce1b9eb29fdb0a06704ec3ff6325707bd..eec1b9fde2450d434d5a53b5597e14d90aeda957 100644 (file)
@@ -975,7 +975,7 @@ static int __init pf_init_unit(struct pf_unit *pf, bool autoprobe, int port,
 out_pi_release:
        pi_release(pf->pi);
 out_free_disk:
-       blk_cleanup_disk(pf->disk);
+       put_disk(pf->disk);
 out_free_tag_set:
        blk_mq_free_tag_set(&pf->tag_set);
        return ret;
@@ -1044,7 +1044,7 @@ static void __exit pf_exit(void)
                if (!pf->present)
                        continue;
                del_gendisk(pf->disk);
-               blk_cleanup_disk(pf->disk);
+               put_disk(pf->disk);
                blk_mq_free_tag_set(&pf->tag_set);
                pi_release(pf->pi);
        }
index 789093375344310e882c4314cdecd0bac1637d7a..653d24231483009f92d3a0a6d8f302b03f3ca252 100644 (file)
@@ -2733,7 +2733,7 @@ static int pkt_setup_dev(dev_t dev, dev_t* pkt_dev)
        return 0;
 
 out_mem2:
-       blk_cleanup_disk(disk);
+       put_disk(disk);
 out_mem:
        mempool_exit(&pd->rb_pool);
        kfree(pd);
@@ -2783,7 +2783,7 @@ static int pkt_remove_dev(dev_t pkt_dev)
        pkt_dbg(1, pd, "writer unmapped\n");
 
        del_gendisk(pd->disk);
-       blk_cleanup_disk(pd->disk);
+       put_disk(pd->disk);
 
        mempool_exit(&pd->rb_pool);
        kfree(pd);
index 3054adf7746036e5357d893f88ad17cacceeca90..36d7b36c60c76bd705115f4ce61bf1c50bafab11 100644 (file)
@@ -473,7 +473,7 @@ static int ps3disk_probe(struct ps3_system_bus_device *_dev)
 
        return 0;
 fail_cleanup_disk:
-       blk_cleanup_disk(gendisk);
+       put_disk(gendisk);
 fail_free_tag_set:
        blk_mq_free_tag_set(&priv->tag_set);
 fail_teardown:
@@ -500,7 +500,7 @@ static void ps3disk_remove(struct ps3_system_bus_device *_dev)
                    &ps3disk_mask);
        mutex_unlock(&ps3disk_mask_mutex);
        del_gendisk(priv->gendisk);
-       blk_cleanup_disk(priv->gendisk);
+       put_disk(priv->gendisk);
        blk_mq_free_tag_set(&priv->tag_set);
        dev_notice(&dev->sbd.core, "Synchronizing disk cache\n");
        ps3disk_sync_cache(dev);
index 4f90819e245e9974776aa8d2b2c46662ac7ec67c..d1e0fefec90ba22d89ad06ae6ea5f3bc930b5037 100644 (file)
@@ -761,7 +761,7 @@ static int ps3vram_probe(struct ps3_system_bus_device *dev)
        return 0;
 
 out_cleanup_disk:
-       blk_cleanup_disk(gendisk);
+       put_disk(gendisk);
 out_cache_cleanup:
        remove_proc_entry(DEVICE_NAME, NULL);
        ps3vram_cache_cleanup(dev);
@@ -792,7 +792,7 @@ static void ps3vram_remove(struct ps3_system_bus_device *dev)
        struct ps3vram_priv *priv = ps3_system_bus_get_drvdata(dev);
 
        del_gendisk(priv->gendisk);
-       blk_cleanup_disk(priv->gendisk);
+       put_disk(priv->gendisk);
        remove_proc_entry(DEVICE_NAME, NULL);
        ps3vram_cache_cleanup(dev);
        iounmap(priv->reports);
index ef9bc62e9afd7f41b3065adfd52ea1c4506fd217..0d8ec2fe574001532dd0346588a5ac1a805df776 100644 (file)
@@ -4729,7 +4729,7 @@ static blk_status_t rbd_queue_rq(struct blk_mq_hw_ctx *hctx,
 
 static void rbd_free_disk(struct rbd_device *rbd_dev)
 {
-       blk_cleanup_disk(rbd_dev->disk);
+       put_disk(rbd_dev->disk);
        blk_mq_free_tag_set(&rbd_dev->tag_set);
        rbd_dev->disk = NULL;
 }
index a4470374f54fc511a1658e21095781dd84512f63..b8d9e2824d9c715b1028dd87e8789ae1f5c4ddf4 100644 (file)
@@ -1408,7 +1408,7 @@ static int rnbd_clt_setup_gen_disk(struct rnbd_clt_dev *dev, int idx)
        blk_queue_flag_set(QUEUE_FLAG_NONROT, dev->queue);
        err = add_disk(dev->gd);
        if (err)
-               blk_cleanup_disk(dev->gd);
+               put_disk(dev->gd);
 
        return err;
 }
@@ -1630,7 +1630,7 @@ put_sess:
 static void destroy_gen_disk(struct rnbd_clt_dev *dev)
 {
        del_gendisk(dev->gd);
-       blk_cleanup_disk(dev->gd);
+       put_disk(dev->gd);
 }
 
 static void destroy_sysfs(struct rnbd_clt_dev *dev,
index dd0a1a6fed29618b56baf61a49e1c89d29f0ea91..fb855da971ee7b388efd1f385fe6c929bda97d4f 100644 (file)
@@ -886,7 +886,7 @@ static int probe_disk(struct vdc_port *port)
        return 0;
 
 out_cleanup_disk:
-       blk_cleanup_disk(g);
+       put_disk(g);
 out_free_tag:
        blk_mq_free_tag_set(&port->tag_set);
        return err;
@@ -1070,7 +1070,7 @@ static void vdc_port_remove(struct vio_dev *vdev)
                del_timer_sync(&port->vio.timer);
 
                del_gendisk(port->disk);
-               blk_cleanup_disk(port->disk);
+               put_disk(port->disk);
                blk_mq_free_tag_set(&port->tag_set);
 
                vdc_free_tx_ring(port);
index fef65a18d56fa9f88587450cdb7abed6fcc7989b..42b4b682869096c351800388f969171619461847 100644 (file)
@@ -783,7 +783,7 @@ static void swim_cleanup_floppy_disk(struct floppy_state *fs)
        if (fs->registered)
                del_gendisk(fs->disk);
 
-       blk_cleanup_disk(disk);
+       put_disk(disk);
        blk_mq_free_tag_set(&fs->tag_set);
 }
 
index 6c39f2c9f806d8c68d89a8102f9b79849d97b16e..da811a7da03f3dff1fa3fc2fc37afc3d6aaf0f6d 100644 (file)
@@ -1238,7 +1238,7 @@ static int swim3_attach(struct macio_dev *mdev,
        return 0;
 
 out_cleanup_disk:
-       blk_cleanup_disk(disk);
+       put_disk(disk);
 out_free_tag_set:
        blk_mq_free_tag_set(&fs->tag_set);
 out_unregister:
index 75057dbbcfbeabfb856bfe7577edb02e881be153..0e1a484cab0b621f8bf559806ac0ef978a4bc53b 100644 (file)
@@ -1377,7 +1377,7 @@ static void carm_free_disk(struct carm_host *host, unsigned int port_no)
 
        if (host->state > HST_DEV_ACTIVATE)
                del_gendisk(disk);
-       blk_cleanup_disk(disk);
+       put_disk(disk);
 }
 
 static int carm_init_shm(struct carm_host *host)
index cff1b6f6b0548a7960b9636bc1bd3f0889f22718..d7d72e8f6e551297ddd7c0e5aa7e654ec8e7c727 100644 (file)
@@ -1089,7 +1089,7 @@ static int virtblk_probe(struct virtio_device *vdev)
        return 0;
 
 out_cleanup_disk:
-       blk_cleanup_disk(vblk->disk);
+       put_disk(vblk->disk);
 out_free_tags:
        blk_mq_free_tag_set(&vblk->tag_set);
 out_free_vq:
index 33f04ef78984c77ed32b576d38729b2d65aa7126..3bc80f35418b6d5f08e963af9fbefca27e14eefe 100644 (file)
@@ -2384,7 +2384,7 @@ static void blkfront_connect(struct blkfront_info *info)
 
        err = device_add_disk(&info->xbdev->dev, info->gd, NULL);
        if (err) {
-               blk_cleanup_disk(info->gd);
+               put_disk(info->gd);
                blk_mq_free_tag_set(&info->tag_set);
                info->rq = NULL;
                goto fail;
@@ -2469,7 +2469,7 @@ static int blkfront_remove(struct xenbus_device *xbdev)
        blkif_free(info, 0);
        if (info->gd) {
                xlbd_release_minors(info->gd->first_minor, info->gd->minors);
-               blk_cleanup_disk(info->gd);
+               put_disk(info->gd);
                blk_mq_free_tag_set(&info->tag_set);
        }
 
index 18ad43d9933ec052cd28962d57f8650e8ad82e0b..c1e85f356e4dfb518dcdc993dbfc73a3679824eb 100644 (file)
@@ -337,7 +337,7 @@ static int z2ram_register_disk(int minor)
        z2ram_gendisk[minor] = disk;
        err = add_disk(disk);
        if (err)
-               blk_cleanup_disk(disk);
+               put_disk(disk);
        return err;
 }
 
index b8549c61ff2ce6f3be633c667eb88452016ed2ba..e5233c911e43646a60fb59d294dcb98ffa448259 100644 (file)
@@ -1957,7 +1957,7 @@ static int zram_add(void)
        return device_id;
 
 out_cleanup_disk:
-       blk_cleanup_disk(zram->disk);
+       put_disk(zram->disk);
 out_free_idr:
        idr_remove(&zram_index_idr, device_id);
 out_free_dev:
@@ -2008,7 +2008,7 @@ static int zram_remove(struct zram *zram)
         */
        zram_reset_device(zram);
 
-       blk_cleanup_disk(zram->disk);
+       put_disk(zram->disk);
        kfree(zram);
        return 0;
 }
index f4cc90ea6198e76a7f1948c2773677ff146a48ac..ceded5772aac6d7d27b974c038615b7aafc8228f 100644 (file)
@@ -817,7 +817,7 @@ probe_fail_free_irqs:
        free_irq(HW_EVENT_GDROM_DMA, &gd);
        free_irq(HW_EVENT_GDROM_CMD, &gd);
 probe_fail_cleanup_disk:
-       blk_cleanup_disk(gd.disk);
+       put_disk(gd.disk);
 probe_fail_free_tag_set:
        blk_mq_free_tag_set(&gd.tag_set);
 probe_fail_free_cd_info:
index 3563d15dbaf270456094a683182b406fd8a5beb7..9dd752d272f6083b5a74b62f455b26965f0c3a2c 100644 (file)
@@ -884,7 +884,7 @@ static void bcache_device_free(struct bcache_device *d)
        if (disk) {
                ida_simple_remove(&bcache_device_idx,
                                  first_minor_to_idx(disk->first_minor));
-               blk_cleanup_disk(disk);
+               put_disk(disk);
        }
 
        bioset_exit(&d->bio_split);
index 4c04a980fcd9f2f8aad4699ff8e6100e8fce53de..8872f9c6368895116917948240a7ffd9c52749b3 100644 (file)
@@ -1894,7 +1894,7 @@ static void cleanup_mapped_device(struct mapped_device *md)
                        del_gendisk(md->disk);
                }
                dm_queue_destroy_crypto_profile(md->queue);
-               blk_cleanup_disk(md->disk);
+               put_disk(md->disk);
        }
 
        if (md->pending_io) {
index c7ecb0bffda0d58678c57fa44be99aebf73f20d3..076255ec9ba18e4bf2d30cba80b3af9ab81cb0cb 100644 (file)
@@ -5579,7 +5579,7 @@ static void md_free(struct kobject *ko)
 
        if (mddev->gendisk) {
                del_gendisk(mddev->gendisk);
-               blk_cleanup_disk(mddev->gendisk);
+               put_disk(mddev->gendisk);
        }
        percpu_ref_exit(&mddev->writes_pending);
 
@@ -5718,7 +5718,7 @@ static int md_alloc(dev_t dev, char *name)
 out_del_gendisk:
        del_gendisk(disk);
 out_cleanup_disk:
-       blk_cleanup_disk(disk);
+       put_disk(disk);
 out_unlock_disks_mutex:
        mutex_unlock(&disks_mutex);
        mddev_put(mddev);
index ba7e7249a3db46b7fc22c86b8dd9926d7f2dc676..ed9a683b3ca8603d9f86b79d86e27b8466dba0bb 100644 (file)
@@ -2129,7 +2129,7 @@ static int msb_init_disk(struct memstick_dev *card)
        return 0;
 
 out_cleanup_disk:
-       blk_cleanup_disk(msb->disk);
+       put_disk(msb->disk);
 out_free_tag_set:
        blk_mq_free_tag_set(&msb->tag_set);
 out_release_id:
index 72e91c06c618bb35e54638b0202192f3e9013aa4..61cf75d4a01eacc40ab0b4364a6da206ac83c88b 100644 (file)
@@ -1209,7 +1209,7 @@ static int mspro_block_init_disk(struct memstick_dev *card)
        return 0;
 
 out_cleanup_disk:
-       blk_cleanup_disk(msb->disk);
+       put_disk(msb->disk);
 out_free_tag_set:
        blk_mq_free_tag_set(&msb->tag_set);
 out_release_id:
index f73172111465501eb043fdca37e612f7655156f1..60b222799871e8fcd89e3e1c5bd569b34ecf51b1 100644 (file)
@@ -29,7 +29,7 @@ static void blktrans_dev_release(struct kref *kref)
        struct mtd_blktrans_dev *dev =
                container_of(kref, struct mtd_blktrans_dev, ref);
 
-       blk_cleanup_disk(dev->disk);
+       put_disk(dev->disk);
        blk_mq_free_tag_set(dev->tag_set);
        kfree(dev->tag_set);
        list_del(&dev->list);
@@ -398,7 +398,7 @@ int add_mtd_blktrans_dev(struct mtd_blktrans_dev *new)
        return 0;
 
 out_cleanup_disk:
-       blk_cleanup_disk(new->disk);
+       put_disk(new->disk);
 out_free_tag_set:
        blk_mq_free_tag_set(new->tag_set);
 out_kfree_tag_set:
index a78fdf3b30f7e6d1d8916c5556c2a01e1f0b6563..4cf67a2a0d04b3064ef82f03b0f45a46972df0b7 100644 (file)
@@ -467,7 +467,7 @@ out_destroy_wq:
 out_remove_minor:
        idr_remove(&ubiblock_minor_idr, gd->first_minor);
 out_cleanup_disk:
-       blk_cleanup_disk(dev->gd);
+       put_disk(dev->gd);
 out_free_tags:
        blk_mq_free_tag_set(&dev->tag_set);
 out_free_dev:
@@ -486,7 +486,7 @@ static void ubiblock_cleanup(struct ubiblock *dev)
        destroy_workqueue(dev->wq);
        /* Finally destroy the blk queue */
        dev_info(disk_to_dev(dev->gd), "released");
-       blk_cleanup_disk(dev->gd);
+       put_disk(dev->gd);
        blk_mq_free_tag_set(&dev->tag_set);
        idr_remove(&ubiblock_minor_idr, dev->gd->first_minor);
 }
index 9613e54c7a675bd7cb07f24612abf4143b423a34..5e622c0d4b66a7a8fc01c9ca0fed1a339f1d34e6 100644 (file)
@@ -1548,14 +1548,14 @@ static int btt_blk_init(struct btt *btt)
        return 0;
 
 out_cleanup_disk:
-       blk_cleanup_disk(btt->btt_disk);
+       put_disk(btt->btt_disk);
        return rc;
 }
 
 static void btt_blk_cleanup(struct btt *btt)
 {
        del_gendisk(btt->btt_disk);
-       blk_cleanup_disk(btt->btt_disk);
+       put_disk(btt->btt_disk);
 }
 
 /**
index 629d10fcf53b2c0e828e6b9641189562b105b293..a72b81fa324260e2ee3755e972c2b0cbabb229aa 100644 (file)
@@ -450,7 +450,7 @@ static void pmem_release_disk(void *__pmem)
        put_dax(pmem->dax_dev);
        del_gendisk(pmem->disk);
 
-       blk_cleanup_disk(pmem->disk);
+       put_disk(pmem->disk);
 }
 
 static int pmem_attach_disk(struct device *dev,
@@ -596,7 +596,7 @@ out_cleanup_dax:
        kill_dax(pmem->dax_dev);
        put_dax(pmem->dax_dev);
 out:
-       blk_cleanup_disk(pmem->disk);
+       put_disk(pmem->disk);
        return rc;
 }
 
index 4e3a0f7bfc9c1cc0876948f7d22fe94fe957b11d..b5b24998a5ab7ef6da257b5455b960da345ec37a 100644 (file)
@@ -4061,7 +4061,7 @@ static void nvme_alloc_ns(struct nvme_ctrl *ctrl, unsigned nsid,
        mutex_unlock(&ctrl->subsys->lock);
        nvme_put_ns_head(ns->head);
  out_cleanup_disk:
-       blk_cleanup_disk(disk);
+       put_disk(disk);
  out_free_ns:
        kfree(ns);
  out_free_id:
index d3e2440d8abb059b44dcab8c32a184e7710f0778..ccf9a6da8f6e1dff6db3bc534f9d18e2a4e3e565 100644 (file)
@@ -853,7 +853,7 @@ void nvme_mpath_remove_disk(struct nvme_ns_head *head)
        /* make sure all pending bios are cleaned up */
        kblockd_schedule_work(&head->requeue_work);
        flush_work(&head->requeue_work);
-       blk_cleanup_disk(head->disk);
+       put_disk(head->disk);
 }
 
 void nvme_mpath_init_ctrl(struct nvme_ctrl *ctrl)
index 8d0d0eaa30594556f879275d6852f18c8f9bfe20..4d8d1759775ae7c6b5a2ce16dfb99a42e4e1cd08 100644 (file)
@@ -414,7 +414,7 @@ removeseg:
        kill_dax(dev_info->dax_dev);
        put_dax(dev_info->dax_dev);
        del_gendisk(dev_info->gd);
-       blk_cleanup_disk(dev_info->gd);
+       put_disk(dev_info->gd);
        up_write(&dcssblk_devices_sem);
 
        if (device_remove_file_self(dev, attr)) {
@@ -712,7 +712,7 @@ out_dax:
        put_dax(dev_info->dax_dev);
 put_dev:
        list_del(&dev_info->lh);
-       blk_cleanup_disk(dev_info->gd);
+       put_disk(dev_info->gd);
        list_for_each_entry(seg_info, &dev_info->seg_list, lh) {
                segment_unload(seg_info->segment_name);
        }
@@ -722,7 +722,7 @@ put_dev:
 dev_list_del:
        list_del(&dev_info->lh);
 release_gd:
-       blk_cleanup_disk(dev_info->gd);
+       put_disk(dev_info->gd);
        up_write(&dcssblk_devices_sem);
 seg_list_del:
        if (dev_info == NULL)
@@ -790,7 +790,7 @@ dcssblk_remove_store(struct device *dev, struct device_attribute *attr, const ch
        kill_dax(dev_info->dax_dev);
        put_dax(dev_info->dax_dev);
        del_gendisk(dev_info->gd);
-       blk_cleanup_disk(dev_info->gd);
+       put_disk(dev_info->gd);
 
        /* unload all related segments */
        list_for_each_entry(entry, &dev_info->seg_list, lh)
index 2a9c0ddcade592547900289666ae20477183620b..0c1df1d5f1aca192962ca325a1bc3e474e40a852 100644 (file)
@@ -501,7 +501,7 @@ int scm_blk_dev_setup(struct scm_blk_dev *bdev, struct scm_device *scmdev)
        return 0;
 
 out_cleanup_disk:
-       blk_cleanup_disk(bdev->gendisk);
+       put_disk(bdev->gendisk);
 out_tag:
        blk_mq_free_tag_set(&bdev->tag_set);
 out:
@@ -512,7 +512,7 @@ out:
 void scm_blk_dev_cleanup(struct scm_blk_dev *bdev)
 {
        del_gendisk(bdev->gendisk);
-       blk_cleanup_disk(bdev->gendisk);
+       put_disk(bdev->gendisk);
        blk_mq_free_tag_set(&bdev->tag_set);
 }
 
index 530eeccffda395cfb1b7d9c3f6066570dc86a925..22b12531aeb7168f0db2775307bf54ff7265adf8 100644 (file)
@@ -834,7 +834,6 @@ struct gendisk *__blk_alloc_disk(int node, struct lock_class_key *lkclass);
                                                                        \
        __blk_alloc_disk(node_id, &__key);                              \
 })
-void blk_cleanup_disk(struct gendisk *disk);
 
 int __register_blkdev(unsigned int major, const char *name,
                void (*probe)(dev_t devt));