]> git.baikalelectronics.ru Git - kernel.git/commit
null_blk: move duplicate code to callers
authorChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Fri, 23 Aug 2019 04:45:14 +0000 (21:45 -0700)
committerJens Axboe <axboe@kernel.dk>
Fri, 23 Aug 2019 12:58:04 +0000 (06:58 -0600)
commit824668a2291970b06c4b2dc3565542e28ed2993a
tree6d877f5efb7d24c3c4114713f60616c67384e9a8
parent8297d4404d110ab99142108cd510744772ba5e03
null_blk: move duplicate code to callers

This is a preparation patch which moves the duplicate code for sectors
and nr_sectors calculations for bio vs request mode into their
respective callers (null_queue_bio(), null_qeueue_req()). Now the core
function only deals with the respective actions and commands instead of
having to calculte the bio vs req operations and different sector
related variables. We also move the flush command handling at the top
which significantly simplifies the rest of the code.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/null_blk_main.c