nbd: refactor size updates
authorChristoph Hellwig <hch@lst.de>
Mon, 16 Nov 2020 14:56:59 +0000 (15:56 +0100)
committerJens Axboe <axboe@kernel.dk>
Mon, 16 Nov 2020 15:34:14 +0000 (08:34 -0700)
commit2dc691cc4ac259f8b5bb0bd8670645af894d30eb
tree1c480cc11d699018b66daf7363c112b1eba952f3
parent92f93c3a1bf9dc73181dc6566497d16b690cb576
nbd: refactor size updates

Merge nbd_size_set and nbd_size_update into a single function that also
updates the nbd_config fields.  This new function takes the device size
in bytes as the first argument, and the blocksize as the second argument,
simplifying the calculations required in most callers.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/nbd.c