Commit c8095793 authored by Chi Zhiling's avatar Chi Zhiling Committed by Andrew Morton
Browse files

readahead: use folio_nr_pages() instead of shift operation

folio_nr_pages() is faster helper function to get the number of pages when
NR_PAGES_IN_LARGE_FOLIO is enabled.

Link: https://lkml.kernel.org/r/20250710060451.3535957-1-chizhiling@163.com


Signed-off-by: default avatarChi Zhiling <chizhiling@kylinos.cn>
Acked-by: default avatarDavid Hildenbrand <david@redhat.com>
Reviewed-by: default avatarRyan Roberts <ryan.roberts@arm.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 188cb385
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -649,7 +649,7 @@ void page_cache_async_ra(struct readahead_control *ractl,
	 * Ramp up sizes, and push forward the readahead window.
	 */
	expected = round_down(ra->start + ra->size - ra->async_size,
			1UL << folio_order(folio));
			folio_nr_pages(folio));
	if (index == expected) {
		ra->start += ra->size;
		/*