Commit 979c690d authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

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: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent f0b870df
......@@ -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 @@ int bdev_disk_changed(struct block_device *bdev, bool invalidate)
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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment