diff options
author | Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> | 2021-06-09 18:32:50 -0700 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2021-06-17 15:51:20 +0200 |
commit | 9a01b58c22ccabd00e990e9dc01c2de5865d6e4d (patch) | |
tree | a2228fa03acbf1d1e8514e92d1e1bedae5e05344 /drivers/nvme/target/io-cmd-bdev.c | |
parent | 6e597263f990a2db99e7380debc4044c38867971 (diff) | |
download | linux-9a01b58c22ccabd00e990e9dc01c2de5865d6e4d.tar.bz2 |
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>
Diffstat (limited to 'drivers/nvme/target/io-cmd-bdev.c')
-rw-r--r-- | drivers/nvme/target/io-cmd-bdev.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/nvme/target/io-cmd-bdev.c b/drivers/nvme/target/io-cmd-bdev.c index 5d998e5873d3..019cc994efcd 100644 --- a/drivers/nvme/target/io-cmd-bdev.c +++ b/drivers/nvme/target/io-cmd-bdev.c @@ -164,8 +164,7 @@ static void nvmet_bio_done(struct bio *bio) struct nvmet_req *req = bio->bi_private; nvmet_req_complete(req, blk_to_nvme_status(req, bio->bi_status)); - if (bio != &req->b.inline_bio) - bio_put(bio); + nvmet_req_bio_put(req, bio); } #ifdef CONFIG_BLK_DEV_INTEGRITY |