]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
rbd: decouple header read-in from updating rbd_dev->header
authorIlya Dryomov <idryomov@gmail.com>
Thu, 5 Oct 2023 09:59:33 +0000 (11:59 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 10 Oct 2023 19:59:05 +0000 (21:59 +0200)
commitab73e7ed79d3e630d536e4b2a1f15159d3d6246b
tree4e0931bc477d59c42ff3e09d40c628774c58df70
parentb4ddad3fb0eadf08b5a0bbd7bb374ebb079a5d54
rbd: decouple header read-in from updating rbd_dev->header

commit 510a7330c82a7754d5df0117a8589e8a539067c7 upstream.

Make rbd_dev_header_info() populate a passed struct rbd_image_header
instead of rbd_dev->header and introduce rbd_dev_update_header() for
updating mutable fields in rbd_dev->header upon refresh.  The initial
read-in of both mutable and immutable fields in rbd_dev_image_probe()
passes in rbd_dev->header so no update step is required there.

rbd_init_layout() is now called directly from rbd_dev_image_probe()
instead of individually in format 1 and format 2 implementations.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Dongsheng Yang <dongsheng.yang@easystack.cn>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/block/rbd.c