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
10761076 xa_destroy(&disk->part_tbl);
10771077 if (test_bit(GD_QUEUE_REF, &disk->state) && disk->queue)
10781078 blk_put_queue(disk->queue);
1079− bdput(disk->part0); /* frees the disk */
1079+ iput(disk->part0->bd_inode); /* frees the disk */
10801080 }
10811081 struct class block_class = {
10821082 .name = "block",
@@ -1261,7 +1261,7 @@ struct gendisk *__alloc_disk_node(int minors, int node_id) · 178 unmodified lines
12611261
12621262 out_destroy_part_tbl:
12631263 xa_destroy(&disk->part_tbl);
1264− bdput(disk->part0);
1264+ iput(disk->part0->bd_inode);
12651265 out_free_disk:
12661266 kfree(disk);
12671267 return NULL;
block/partitions/core.c+1−1
@@ -262,7 +262,7 @@ static void part_release(struct device *dev) · 261 unmodified lines
262262 if (MAJOR(dev->devt) == BLOCK_EXT_MAJOR)
263263 blk_free_ext_minor(MINOR(dev->devt));
264264 put_disk(dev_to_bdev(dev)->bd_disk);
265− bdput(dev_to_bdev(dev));
265+ iput(dev_to_bdev(dev)->bd_inode);
266266 }
267267
268268 static 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
934934 return ret;
935935 }
936936
937−void bdput(struct block_device *bdev)
938−{
939− iput(bdev->bd_inode);
940−}
941−EXPORT_SYMBOL(bdput);
942−
943937 /**
944938 * bd_may_claim - test whether a block device can be claimed
945939 * @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
19841984 struct block_device *bdev_alloc(struct gendisk *disk, u8 partno);
19851985 void bdev_add(struct block_device *bdev, dev_t dev);
19861986 struct block_device *I_BDEV(struct inode *inode);
1987−void bdput(struct block_device *);
19881987 int truncate_bdev_range(struct block_device *bdev, fmode_t mode, loff_t lstart,
19891988 loff_t lend);
19901989