]> www.infradead.org Git - users/hch/block.git/commitdiff
block: remove bdput bdev-lookup-fix.2
authorChristoph Hellwig <hch@lst.de>
Thu, 22 Jul 2021 05:10:58 +0000 (07:10 +0200)
committerChristoph Hellwig <hch@lst.de>
Thu, 22 Jul 2021 13:23:47 +0000 (15:23 +0200)
Now that we've stopped using inode references for anything meaninful
in the block layer get rid of the helper to put it and just open code
the call to iput on the block_device inode.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
block/genhd.c
block/partitions/core.c
fs/block_dev.c
include/linux/blkdev.h

index 7b4beadaa6947726c709cb39687b4c73be6a9d62..700d9d291546ece13b442995158d08260996b0c9 100644 (file)
@@ -1077,7 +1077,7 @@ static void disk_release(struct device *dev)
        xa_destroy(&disk->part_tbl);
        if (test_bit(GD_QUEUE_REF, &disk->state) && disk->queue)
                blk_put_queue(disk->queue);
-       bdput(disk->part0);     /* frees the disk */
+       iput(disk->part0->bd_inode);    /* frees the disk */
 }
 struct class block_class = {
        .name           = "block",
@@ -1262,7 +1262,7 @@ struct gendisk *__alloc_disk_node(int minors, int node_id)
 
 out_destroy_part_tbl:
        xa_destroy(&disk->part_tbl);
-       bdput(disk->part0);
+       iput(disk->part0->bd_inode);
 out_free_disk:
        kfree(disk);
        return NULL;
index 1b02073a2047f89f3ab22a84c7bb0a6c5e634ff9..8d8be1187b9e4bc7ef1446396cd7ce2d2f52054d 100644 (file)
@@ -262,7 +262,7 @@ static void part_release(struct device *dev)
        if (MAJOR(dev->devt) == BLOCK_EXT_MAJOR)
                blk_free_ext_minor(MINOR(dev->devt));
        put_disk(dev_to_bdev(dev)->bd_disk);
-       bdput(dev_to_bdev(dev));
+       iput(dev_to_bdev(dev)->bd_inode);
 }
 
 static int part_uevent(struct device *dev, struct kobj_uevent_env *env)
index 4f2c4e9e84f57cd790a8c3e0bbef8e3e6f49073c..6658f40ae492d6d16e5bf9bb51ca9b442b5227aa 100644 (file)
@@ -934,12 +934,6 @@ long nr_blockdev_pages(void)
        return ret;
 }
 
-void bdput(struct block_device *bdev)
-{
-       iput(bdev->bd_inode);
-}
-EXPORT_SYMBOL(bdput);
 /**
  * bd_may_claim - test whether a block device can be claimed
  * @bdev: block device of interest
index 98772da38bb16887522c9d26df150c7a5bbcc844..b94de1d194b8bae85a89c8e124097096595e4f72 100644 (file)
@@ -1984,7 +1984,6 @@ void blkdev_put_no_open(struct block_device *bdev);
 struct block_device *bdev_alloc(struct gendisk *disk, u8 partno);
 void bdev_add(struct block_device *bdev, dev_t dev);
 struct block_device *I_BDEV(struct inode *inode);
-void bdput(struct block_device *);
 int truncate_bdev_range(struct block_device *bdev, fmode_t mode, loff_t lstart,
                loff_t lend);