]> 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)
commitaf7332c4934c085edb923c894dc44a888e58046d
tree6d877f5efb7d24c3c4114713f60616c67384e9a8
parent998d0d82da3cddb17af437a1370cfbe2cd859023
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