]> www.infradead.org Git - users/hch/misc.git/commitdiff
scsi: use request to get integrity segments
authorKeith Busch <kbusch@kernel.org>
Fri, 13 Sep 2024 18:28:51 +0000 (11:28 -0700)
committerJens Axboe <axboe@kernel.dk>
Fri, 13 Sep 2024 18:31:45 +0000 (12:31 -0600)
The request tracks the integrity segments already, so no need to recount
the segments again.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Kanchan Joshi <joshi.k@samsung.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Link: https://lore.kernel.org/r/20240913182854.2445457-7-kbusch@meta.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/scsi/scsi_lib.c

index 3958a6d14bf457eb2acef5576d02c64c7d3972bc..c602b0af745caa482fbe2c9e0cdf7ae41be9bfbb 100644 (file)
@@ -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 = rq->nr_integrity_segments;
                if (sg_alloc_table_chained(&prot_sdb->table, ivecs,
                                prot_sdb->table.sgl,
                                SCSI_INLINE_PROT_SG_CNT)) {