]> www.infradead.org Git - users/hch/block.git/commitdiff
block: remove bdgrab
authorChristoph Hellwig <hch@lst.de>
Thu, 22 Jul 2021 04:53:50 +0000 (06:53 +0200)
committerChristoph Hellwig <hch@lst.de>
Thu, 22 Jul 2021 13:23:47 +0000 (15:23 +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>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
fs/block_dev.c
include/linux/blkdev.h

index 4a6c8c0a3bc99fb8f2695892e65ebf077fee214a..4f2c4e9e84f57cd790a8c3e0bbef8e3e6f49073c 100644 (file)
@@ -921,21 +921,6 @@ void bdev_add(struct block_device *bdev, dev_t dev)
        insert_inode_hash(bdev->bd_inode);
 }
 
-/**
- * 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);