[RFC PATCH 11/34] nvmet: use bio_new in nvmet_bdev_execute_rw
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: linux-xfs@xxxxxxxxxxxxxxx, linux-fsdevel@xxxxxxxxxxxxxxx, dm-devel@xxxxxxxxxx, linux-block@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, drbd-dev@xxxxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, linux-nvme@xxxxxxxxxxxxxxxxxxx, linux-scsi@xxxxxxxxxxxxxxx, target-devel@xxxxxxxxxxxxxxx, linux-fscrypt@xxxxxxxxxxxxxxx, jfs-discussion@xxxxxxxxxxxxxxxxxxxxx, linux-nilfs@xxxxxxxxxxxxxxx, ocfs2-devel@xxxxxxxxxxxxxx, linux-pm@xxxxxxxxxxxxxxx, linux-mm@xxxxxxxxx
- Subject: [RFC PATCH 11/34] nvmet: use bio_new in nvmet_bdev_execute_rw
- From: Chaitanya Kulkarni <chaitanya.kulkarni@xxxxxxx>
- Date: Wed, 27 Jan 2021 23:11:10 -0800
- In-reply-to: <20210128071133.60335-1-chaitanya.kulkarni@wdc.com>
- Ironport-sdr: nBo2YCNknXHmtMPRQuIO4KAfWfGeqA6uck1BQD9JfufC5HgzoEEcB1X4Sj24VYgnn8H3M2PysO RUCjtpxPvJhYZ0T4lscfpyc8S9OtQ2IUeXJuzaOK4tdHhi4NOMmwNkq+//nvKIOX9CBpmsZVFM WQjMxWp4X4RsCjp+fXPzpsxGnDVO3RBp7+U+L199J1lrFpzEznO0V2ixP1PK2DMWNafqlJaYWJ +i4eaYy57NQrWPxLf822AkJZgRgcLMRpiQKwZ8NbQx7DgzmNGZCSWfuYReERddJuZ/Km2EP8L5 It0=
- Ironport-sdr: 8uRtmtQ6dIrH8p7m3RozWKU685yyc1qPWWh0Sv8nAPd2vXVO5xFD+5u4U+ejNRi2a/Z43QxlMu xXFrwXflfX5glQh/Rb9/TIMFKsSsmQs2YjF8AABNm2TJc+ntINwbchjA9a6FogNHGR12HrtEyY XUN7Ctkdgns9yr4lfm8CsGtzE4bDUWCpEjTyjEdHhUFi2qFDZZIsKtv8BGmCl8eSQx7MT+V9iS 5seOOqC2KdCxMc1plODtMVxJ/WtKzTYbOxjz3ASFL4okYl2mOxASP9yK2e4kHwtI5dY8LP6jJZ vS6TYyT6/f3x0ZAQ1ai3Gt3o
- Ironport-sdr: S7K4kJLXzJBN+TtdhPMN6TP/Dffs+zSa3G/de5+S1/PIJxe5GMDYhILg7ObwZaeQtAx8NJxvkl nIc5LC+mPpv7TI+pptGOuvqvgXc2tzfVFCEyc5+LFgl+ipYQILMS5NCsDr+0Wgl54XSWETlfzh gHkg4ZggWJkUuTGFtq5ayNdqurKZ4tOlkNjJtnTH4tbAn7NSWqg+Ok++T//Bdn23FoUZxk+NbJ AQUU7LKb9NmxAxDMj2VCc1ROkgf8sOKgTR+MW0zxXzuua4VhN6N1CvrlPe6fa6RhDqhXPf7MuT aTA=
- References: <20210128071133.60335-1-chaitanya.kulkarni@wdc.com>
- Wdcironportexception: Internal
Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@xxxxxxx>
---
drivers/nvme/target/io-cmd-bdev.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/nvme/target/io-cmd-bdev.c b/drivers/nvme/target/io-cmd-bdev.c
index bf6e0ac9ad28..f5fd93a796a6 100644
--- a/drivers/nvme/target/io-cmd-bdev.c
+++ b/drivers/nvme/target/io-cmd-bdev.c
@@ -225,6 +225,7 @@ static int nvmet_bdev_alloc_bip(struct nvmet_req *req, struct bio *bio,
static void nvmet_bdev_execute_rw(struct nvmet_req *req)
{
+ struct block_device *bdev = req->ns->bdev;
int sg_cnt = req->sg_cnt;
struct bio *bio;
struct scatterlist *sg;
@@ -265,7 +266,7 @@ static void nvmet_bdev_execute_rw(struct nvmet_req *req)
} else {
bio = bio_alloc(GFP_KERNEL, min(sg_cnt, BIO_MAX_PAGES));
}
- bio_set_dev(bio, req->ns->bdev);
+ bio_set_dev(bio, bdev);
bio->bi_iter.bi_sector = sector;
bio->bi_private = req;
bio->bi_end_io = nvmet_bio_done;
@@ -290,11 +291,7 @@ static void nvmet_bdev_execute_rw(struct nvmet_req *req)
}
}
- bio = bio_alloc(GFP_KERNEL, min(sg_cnt, BIO_MAX_PAGES));
- bio_set_dev(bio, req->ns->bdev);
- bio->bi_iter.bi_sector = sector;
- bio->bi_opf = op;
-
+ bio = bio_new(bdev, sector, op, 0, sg_cnt, GFP_KERNEL);
bio_chain(bio, prev);
submit_bio(prev);
}
--
2.22.1
[Index of Archives]
[linux Cryptography]
[Asterisk App Development]
[PJ SIP]
[Gnu Gatekeeper]
[IETF Sipping]
[Info Cyrus]
[ALSA User]
[Fedora Linux Users]
[Linux SCTP]
[DCCP]
[Gimp]
[Yosemite News]
[Deep Creek Hot Springs]
[Yosemite Campsites]
[ISDN Cause Codes]