]> git.baikalelectronics.ru Git - kernel.git/commit
nvmet: add nvmet_req_bio put helper for backends
authorChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Thu, 10 Jun 2021 01:32:50 +0000 (18:32 -0700)
committerChristoph Hellwig <hch@lst.de>
Thu, 17 Jun 2021 13:51:20 +0000 (15:51 +0200)
commitba4a73a982f5e1537e0706438b69590cd801ce01
treea2228fa03acbf1d1e8514e92d1e1bedae5e05344
parentd4658e779fda8bb0e579bcfe15e86a21bb37cc62
nvmet: add nvmet_req_bio put helper for backends

In current code there exists two backends which are using inline bio
optimization, that adds a duplicate code for freeing the bio.

For Zoned Block Device backend we also use the same optimzation and it
will lead to having duplicate code in the three backends: generic
bdev, passsthru, and generic zns.

Add a helper function to avoid duplicate code and update the respective
backends.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/target/io-cmd-bdev.c
drivers/nvme/target/nvmet.h
drivers/nvme/target/passthru.c