]> www.infradead.org Git - users/hch/block.git/commitdiff
block: remove bdgrab
authorChristoph Hellwig <hch@lst.de>
Thu, 1 Jul 2021 11:55:05 +0000 (13:55 +0200)
committerChristoph Hellwig <hch@lst.de>
Wed, 21 Jul 2021 06:32:07 +0000 (08:32 +0200)
All callers are gone, and no one should grab a pure inode reference to
a block device anymore.

Signed-off-by: Christoph Hellwig <hch@lst.de>
fs/block_dev.c
include/linux/blkdev.h

index 7de519dcfdff3777f3d53f7daf27c7f2372481c7..5c56d88fd838a56c4a0bb7e6ad320d26bde52a3e 100644 (file)
@@ -931,21 +931,6 @@ static struct block_device *bdget(dev_t dev)
        return &BDEV_I(inode)->bdev;
 }
 
-/**
- * bdgrab -- Grab a reference to an already referenced block device
- * @bdev:      Block device to grab a reference to.
- *
- * Returns the block_device with an additional reference when successful,
- * or NULL if the inode is already beeing freed.
- */
-struct block_device *bdgrab(struct block_device *bdev)
-{
-       if (!igrab(bdev->bd_inode))
-               return NULL;
-       return bdev;
-}
-EXPORT_SYMBOL(bdgrab);
-
 long nr_blockdev_pages(void)
 {
        struct inode *inode;
index 3177181c43262392011cc72f485f8be1496d12c8..98772da38bb16887522c9d26df150c7a5bbcc844 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);
-struct block_device *bdgrab(struct block_device *bdev);
 void bdput(struct block_device *);
 int truncate_bdev_range(struct block_device *bdev, fmode_t mode, loff_t lstart,
                loff_t lend);