]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit1b63b520f000b9c1c94508dc5f62720ceb10d5bd
tree1c480cc11d699018b66daf7363c112b1eba952f3
parentc83ce18073091601e39d0c608c3c9689f01b6c49
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