Commit e053aefe authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Yongqiang Liu
Browse files

nbd: refactor size updates

mainline inclusion
from mainline-v5.11-rc1
commit 2dc691cc
category: bugfix
bugzilla: 187706, https://gitee.com/openeuler/kernel/issues/I5XEBX


CVE: NA

----------------------------------------

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: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarJosef Bacik <josef@toxicpanda.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>

Conflicts:
	drivers/block/nbd.c

Signed-off-by: default avatarZhong Jinghua <zhongjinghua@huawei.com>
Reviewed-by: default avatarJason Yan <yanaijie@huawei.com>
Reviewed-by: default avatarYu Kuai <yukuai3@huawei.com>
Signed-off-by: default avatarYongqiang Liu <liuyongqiang13@huawei.com>
parent 32a5f63b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment