mirror of
https://github.com/torvalds/linux.git
synced 2024-11-24 21:21:41 +00:00
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 <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>
This commit is contained in:
parent
6f8191fdf4
commit
8b9ab62662
@ -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");
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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";
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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:
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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]);
|
||||
}
|
||||
|
@ -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:
|
||||
|
@ -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:
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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,
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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:
|
||||
|
@ -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)
|
||||
|
@ -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:
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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:
|
||||
|
@ -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);
|
||||
|
@ -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) {
|
||||
|
@ -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);
|
||||
|
@ -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:
|
||||
|
@ -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:
|
||||
|
@ -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:
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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:
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user