diff options
author | Christoph Hellwig <hch@lst.de> | 2021-08-09 16:17:44 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2021-08-09 11:53:26 -0600 |
commit | a11d7fc2d05fb509cd9e33d4093507d6eda3ad53 (patch) | |
tree | e085f4f2ab5aaac4c0bd5a977bb245642026a746 /fs/block_dev.c | |
parent | edb0872f44ec9976ea6d052cb4b93cd2d23ac2ba (diff) |
block: remove the bd_bdi in struct block_device
Just retrieve the bdi from the disk.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Link: https://lore.kernel.org/r/20210809141744.1203023-6-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/block_dev.c')
-rw-r--r-- | fs/block_dev.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/fs/block_dev.c b/fs/block_dev.c index 43be5463a4c4..e1c14c2e0504 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c @@ -801,7 +801,6 @@ static struct inode *bdev_alloc_inode(struct super_block *sb) if (!ei) return NULL; memset(&ei->bdev, 0, sizeof(ei->bdev)); - ei->bdev.bd_bdi = &noop_backing_dev_info; return &ei->vfs_inode; } @@ -826,16 +825,11 @@ static void init_once(void *data) static void bdev_evict_inode(struct inode *inode) { - struct block_device *bdev = &BDEV_I(inode)->bdev; truncate_inode_pages_final(&inode->i_data); invalidate_inode_buffers(inode); /* is it needed here? */ clear_inode(inode); /* Detach inode from wb early as bdi_put() may free bdi->wb */ inode_detach_wb(inode); - if (bdev->bd_bdi != &noop_backing_dev_info) { - bdi_put(bdev->bd_bdi); - bdev->bd_bdi = &noop_backing_dev_info; - } } static const struct super_operations bdev_sops = { @@ -1084,11 +1078,8 @@ static int blkdev_get_whole(struct block_device *bdev, fmode_t mode) } } - if (!bdev->bd_openers) { + if (!bdev->bd_openers) set_init_blocksize(bdev); - if (bdev->bd_bdi == &noop_backing_dev_info) - bdev->bd_bdi = bdi_get(disk->bdi); - } if (test_bit(GD_NEED_PART_SCAN, &disk->state)) bdev_disk_changed(disk, false); bdev->bd_openers++; @@ -1121,8 +1112,6 @@ static int blkdev_get_part(struct block_device *part, fmode_t mode) disk->open_partitions++; set_init_blocksize(part); - if (part->bd_bdi == &noop_backing_dev_info) - part->bd_bdi = bdi_get(disk->bdi); done: part->bd_openers++; return 0; |