block: add a new revalidate_disk_size helper
authorChristoph Hellwig <hch@lst.de>
Tue, 1 Sep 2020 15:57:43 +0000 (17:57 +0200)
committerJens Axboe <axboe@kernel.dk>
Wed, 2 Sep 2020 14:00:07 +0000 (08:00 -0600)
commit659e56ba864d37b7ee0a49cd432205b2a5ca815e
treed318f21ef0098e4ab6c7385bc99bc1b8c5a82f44
parentf4ad06f2bb8476548b08f89919ee65abc4e40212
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>
drivers/block/rbd.c
drivers/block/rnbd/rnbd-clt.c
drivers/block/virtio_blk.c
drivers/block/zram/zram_drv.c
drivers/md/dm-raid.c
drivers/md/md-cluster.c
drivers/md/md-linear.c
drivers/md/md.c
fs/block_dev.c
include/linux/genhd.h