summaryrefslogtreecommitdiff
path: root/drivers/md/md-linear.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-09-01 17:57:43 +0200
committerJens Axboe <axboe@kernel.dk>2020-09-02 08:00:07 -0600
commit659e56ba864d37b7ee0a49cd432205b2a5ca815e (patch)
treed318f21ef0098e4ab6c7385bc99bc1b8c5a82f44 /drivers/md/md-linear.c
parentf4ad06f2bb8476548b08f89919ee65abc4e40212 (diff)
block: add a new revalidate_disk_size helper
revalidate_disk is a relative awkward helper for driver use, as it first calls an optional driver method and then updates the block device size, while most callers either don't need the method call at all, or want to keep state between the caller and the called method. Add a revalidate_disk_size helper that just performs the update of the block device size from the gendisk one, and switch all drivers that do not implement ->revalidate_disk to use the new helper instead of revalidate_disk() Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Josef Bacik <josef@toxicpanda.com> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Acked-by: Song Liu <song@kernel.org> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/md/md-linear.c')
-rw-r--r--drivers/md/md-linear.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/md-linear.c b/drivers/md/md-linear.c
index c2ae9125c4c3..5ab22069b5be 100644
--- a/drivers/md/md-linear.c
+++ b/drivers/md/md-linear.c
@@ -202,7 +202,7 @@ static int linear_add(struct mddev *mddev, struct md_rdev *rdev)
md_set_array_sectors(mddev, linear_size(mddev, 0, 0));
set_capacity(mddev->gendisk, mddev->array_sectors);
mddev_resume(mddev);
- revalidate_disk(mddev->gendisk);
+ revalidate_disk_size(mddev->gendisk, true);
kfree_rcu(oldconf, rcu);
return 0;
}