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.

io_uring/zcrx: remove nth_page() usage within folio

Within a folio/compound page, nth_page() is no longer required. Given
that we call folio_test_partial_kmap()+kmap_local_page(), the code would
already be problematic if the pages would span multiple folios.

So let's just assume that all src pages belong to a single folio/compound
page and can be iterated ordinarily. The dst page is currently always a
single page, so we're not actually iterating anything.

Link: https://lkml.kernel.org/r/20250901150359.867252-21-david@redhat.com
Signed-off-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Pavel Begunkov <asml.silence@gmail.com>
Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

David Hildenbrand and committed by
Andrew Morton
d99c5754 e3c05b6e

+2 -2
+2 -2
io_uring/zcrx.c
··· 975 975 976 976 if (folio_test_partial_kmap(page_folio(dst_page)) || 977 977 folio_test_partial_kmap(page_folio(src_page))) { 978 - dst_page = nth_page(dst_page, dst_offset / PAGE_SIZE); 978 + dst_page += dst_offset / PAGE_SIZE; 979 979 dst_offset = offset_in_page(dst_offset); 980 - src_page = nth_page(src_page, src_offset / PAGE_SIZE); 980 + src_page += src_offset / PAGE_SIZE; 981 981 src_offset = offset_in_page(src_offset); 982 982 n = min(PAGE_SIZE - src_offset, PAGE_SIZE - dst_offset); 983 983 n = min(n, len);