summaryrefslogtreecommitdiff
path: root/fs/block_dev.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2019-11-14 17:34:37 +0300
committerJens Axboe <axboe@kernel.dk>2019-11-14 17:44:01 +0300
commit979c690d9a017db14b7759a099478e3faad991ac (patch)
tree4ebafea98f249e4ac5b30c3c3f7ef6c790c0413c /fs/block_dev.c
parentf0b870df80bc70dad432fd0c142bb709a49964f5 (diff)
downloadlinux-979c690d9a017db14b7759a099478e3faad991ac.tar.xz
block: move clearing bd_invalidated into check_disk_size_change
Both callers of check_disk_size_change clear bd_invalidate directly after the call, so move the clearing into check_disk_size_change itself. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/block_dev.c')
-rw-r--r--fs/block_dev.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/block_dev.c b/fs/block_dev.c
index 9558a2f064b1..ee63c2732fa2 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -1433,6 +1433,7 @@ static void check_disk_size_change(struct gendisk *disk,
if (bdev_size > disk_size)
flush_disk(bdev, false);
}
+ bdev->bd_invalidated = 0;
}
/**
@@ -1462,7 +1463,6 @@ int revalidate_disk(struct gendisk *disk)
mutex_lock(&bdev->bd_mutex);
check_disk_size_change(disk, bdev, ret == 0);
- bdev->bd_invalidated = 0;
mutex_unlock(&bdev->bd_mutex);
bdput(bdev);
}
@@ -1526,7 +1526,6 @@ rescan:
disk->fops->revalidate_disk(disk);
check_disk_size_change(disk, bdev, !invalidate);
- bdev->bd_invalidated = 0;
if (get_capacity(disk)) {
ret = blk_add_partitions(disk, bdev);