[PATCHv3 03/10] scsi: use request helper to get integrity segments

Keith Busch kbusch at meta.com
Wed Sep 4 08:25:58 PDT 2024


From: Keith Busch <kbusch at kernel.org>

The request tracks the integrity segments already, so no need to recount
the segements again.

Signed-off-by: Keith Busch <kbusch at kernel.org>
---
 drivers/scsi/scsi_lib.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 3958a6d14bf45..dc1a1644cbc0c 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -1175,8 +1175,7 @@ blk_status_t scsi_alloc_sgtables(struct scsi_cmnd *cmd)
 			goto out_free_sgtables;
 		}
 
-		ivecs = blk_rq_count_integrity_sg(rq->q, rq->bio);
-
+		ivecs = blk_rq_integrity_segments(rq);
 		if (sg_alloc_table_chained(&prot_sdb->table, ivecs,
 				prot_sdb->table.sgl,
 				SCSI_INLINE_PROT_SG_CNT)) {
-- 
2.43.5




More information about the Linux-nvme mailing list