From: Jan Kara Date: Tue, 25 Jun 2024 10:18:56 +0000 (+0200) Subject: readahead: drop dead code in page_cache_ra_order() X-Git-Tag: v6.11-rc1~85^2~158 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8eaf93ac70f3e1bbbe7e28a4f34289ef2d0d0bef;p=thirdparty%2Flinux.git readahead: drop dead code in page_cache_ra_order() page_cache_ra_order() scales folio order down so that is fully fits within readahead window. Thus the code handling the case where we walked past the readahead window is a dead code. Remove it. Link: https://lkml.kernel.org/r/20240625101909.12234-6-jack@suse.cz Signed-off-by: Jan Kara Reviewed-by: Josef Bacik Tested-by: Zhang Peng Cc: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton --- diff --git a/mm/readahead.c b/mm/readahead.c index 455edafebb079..9ea5125a0dce1 100644 --- a/mm/readahead.c +++ b/mm/readahead.c @@ -525,11 +525,6 @@ void page_cache_ra_order(struct readahead_control *ractl, index += 1UL << order; } - if (index > limit) { - ra->size += index - limit - 1; - ra->async_size += index - limit - 1; - } - read_pages(ractl); filemap_invalidate_unlock_shared(mapping); memalloc_nofs_restore(nofs);