bcache: move calculation of stripe_size and io_opt into bcache_device_init
authorChristoph Hellwig <hch@lst.de>
Mon, 26 Feb 2024 10:48:26 +0000 (11:48 +0100)
committerJens Axboe <axboe@kernel.dk>
Wed, 6 Mar 2024 15:34:19 +0000 (08:34 -0700)
commit34a2cf3fbef17deee2d4d28c41e3cb8ac1929fda
treebe26411a5c5543123a87c115e65b76dd838183e8
parent0e46064ebebb90b02c53283106f26600aa38c986
bcache: move calculation of stripe_size and io_opt into bcache_device_init

bcache currently calculates the stripe size for the non-cached_dev
case directly in bcache_device_init, but for the cached_dev case it does
it in the caller.  Consolidate it in one places, which also enables
setting the io_opt queue_limit before allocating the gendisk so that it
can be passed in instead of changing the limit just after the allocation.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Coly Li <colyli@suse.de>
Link: https://lore.kernel.org/r/20240226104826.283067-2-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/md/bcache/super.c