Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

scsi: scsi_lib: drop nth_page() usage within SG entry

It's no longer required to use nth_page() when iterating pages within a
single SG entry, so let's drop the nth_page() usage.

Link: https://lkml.kernel.org/r/20250901150359.867252-31-david@redhat.com
Signed-off-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

David Hildenbrand and committed by
Andrew Morton
9b6024fa 727fd054

+1 -2
+1 -2
drivers/scsi/scsi_lib.c
··· 3148 3148 /* Offset starting from the beginning of first page in this sg-entry */ 3149 3149 *offset = *offset - len_complete + sg->offset; 3150 3150 3151 - /* Assumption: contiguous pages can be accessed as "page + i" */ 3152 - page = nth_page(sg_page(sg), (*offset >> PAGE_SHIFT)); 3151 + page = sg_page(sg) + (*offset >> PAGE_SHIFT); 3153 3152 *offset &= ~PAGE_MASK; 3154 3153 3155 3154 /* Bytes in this sg-entry from *offset to the end of the page */