]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
readahead: drop dead code in page_cache_ra_order()
authorJan Kara <jack@suse.cz>
Tue, 25 Jun 2024 10:18:56 +0000 (12:18 +0200)
committerAndrew Morton <akpm@linux-foundation.org>
Thu, 4 Jul 2024 02:30:27 +0000 (19:30 -0700)
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 <jack@suse.cz>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Tested-by: Zhang Peng <zhangpengpeng0808@gmail.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/readahead.c

index 455edafebb07933190d6910b9d7c4cea6341b81d..9ea5125a0dce15b47ff549fa4c5d0dd3f8a67ce9 100644 (file)
@@ -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);