]> git.baikalelectronics.ru Git - kernel.git/commit
rnbd-clt: reduce the size of struct rnbd_clt_dev
authorGuoqing Jiang <guoqing.jiang@linux.dev>
Wed, 6 Jul 2022 13:31:48 +0000 (21:31 +0800)
committerJens Axboe <axboe@kernel.dk>
Tue, 2 Aug 2022 23:14:45 +0000 (17:14 -0600)
commitdfc270c908e81f586c1165acbd9bc5c6d18c3fc0
tree29402bbe281e3c08e892b00d5a1a565f9a3e9249
parent017d76f45e81bd1b741e16c5fed6baeb80460dff
rnbd-clt: reduce the size of struct rnbd_clt_dev

Previously, both map and remap trigger rnbd_clt_set_dev_attr to set
some members in rnbd_clt_dev such as wc, fua and logical_block_size
etc, but those members are only useful for map scenario given the
setup_request_queue is only called from the path:

rnbd_clt_map_device -> rnbd_client_setup_device

Since rnbd_clt_map_device frees rsp after rnbd_client_setup_device,
we can pass rsp to rnbd_client_setup_device and it's callees, which
means queue's attributes can be set directly from relevant members
of rsp instead from rnbd_clt_dev.

After that, we can kill 11 members from rnbd_clt_dev, and we don't
need rnbd_clt_set_dev_attr either.

Acked-by: Jack Wang <jinpu.wang@ionos.com>
Signed-off-by: Guoqing Jiang <guoqing.jiang@linux.dev>
Link: https://lore.kernel.org/r/20220706133152.12058-5-guoqing.jiang@linux.dev
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/rnbd/rnbd-clt.c
drivers/block/rnbd/rnbd-clt.h