History

block: remove bdput

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.

Christoph Hellwig committed 5 years ago

Commit 2f4731d1 parent 14cf1db4 files · +3 −10Browse files

Unified · Split

4 files
  1. block/genhd.c +2 −2
  2. block/partitions/core.c +1 −1
  3. fs/block_dev.c +0 −6
  4. include/linux/blkdev.h +0 −1
block/genhd.c+2−2
@@ -1076,7 +1076,7 @@ static void disk_release(struct device *dev) · 1075 unmodified lines
1076 xa_destroy(&disk->part_tbl);1076 xa_destroy(&disk->part_tbl);
1077 if (test_bit(GD_QUEUE_REF, &disk->state) && disk->queue)1077 if (test_bit(GD_QUEUE_REF, &disk->state) && disk->queue)
1078 blk_put_queue(disk->queue);1078 blk_put_queue(disk->queue);
1079 bdput(disk->part0); /* frees the disk */1079 iput(disk->part0->bd_inode); /* frees the disk */
1080}1080}
1081struct class block_class = {1081struct class block_class = {
1082 .name = "block",1082 .name = "block",
@@ -1261,7 +1261,7 @@ struct gendisk *__alloc_disk_node(int minors, int node_id) · 178 unmodified lines
1261 1261
1262out_destroy_part_tbl:1262out_destroy_part_tbl:
1263 xa_destroy(&disk->part_tbl);1263 xa_destroy(&disk->part_tbl);
1264 bdput(disk->part0);1264 iput(disk->part0->bd_inode);
1265out_free_disk:1265out_free_disk:
1266 kfree(disk);1266 kfree(disk);
1267 return NULL;1267 return NULL;
block/partitions/core.c+1−1
@@ -262,7 +262,7 @@ static void part_release(struct device *dev) · 261 unmodified lines
262 if (MAJOR(dev->devt) == BLOCK_EXT_MAJOR)262 if (MAJOR(dev->devt) == BLOCK_EXT_MAJOR)
263 blk_free_ext_minor(MINOR(dev->devt));263 blk_free_ext_minor(MINOR(dev->devt));
264 put_disk(dev_to_bdev(dev)->bd_disk);264 put_disk(dev_to_bdev(dev)->bd_disk);
265 bdput(dev_to_bdev(dev));265 iput(dev_to_bdev(dev)->bd_inode);
266}266}
267 267
268static int part_uevent(struct device *dev, struct kobj_uevent_env *env)268static int part_uevent(struct device *dev, struct kobj_uevent_env *env)
fs/block_dev.c+0−6
@@ -934,12 +934,6 @@ long nr_blockdev_pages(void) · 933 unmodified lines
934 return ret;934 return ret;
935}935}
936 936
937void bdput(struct block_device *bdev)
938{
939 iput(bdev->bd_inode);
940}
941EXPORT_SYMBOL(bdput);
942
943/**937/**
944 * bd_may_claim - test whether a block device can be claimed938 * bd_may_claim - test whether a block device can be claimed
945 * @bdev: block device of interest939 * @bdev: block device of interest
include/linux/blkdev.h+0−1
@@ -1984,7 +1984,6 @@ void blkdev_put_no_open(struct block_device *bdev); · 1983 unmodified lines
1984struct block_device *bdev_alloc(struct gendisk *disk, u8 partno);1984struct block_device *bdev_alloc(struct gendisk *disk, u8 partno);
1985void bdev_add(struct block_device *bdev, dev_t dev);1985void bdev_add(struct block_device *bdev, dev_t dev);
1986struct block_device *I_BDEV(struct inode *inode);1986struct block_device *I_BDEV(struct inode *inode);
1987void bdput(struct block_device *);
1988int truncate_bdev_range(struct block_device *bdev, fmode_t mode, loff_t lstart,1987int truncate_bdev_range(struct block_device *bdev, fmode_t mode, loff_t lstart,
1989 loff_t lend);1988 loff_t lend);
1990 1989