Skip to content

Commit

Permalink
mm/filemap: increase usage of folio_next_index() helper
Browse files Browse the repository at this point in the history
Simplify code pattern of 'folio->index + folio_nr_pages(folio)' by using
the existing helper folio_next_index() in filemap_get_folios_contig().

Link: https://lkml.kernel.org/r/20231107024635.4512-1-duminjie@vivo.com
Signed-off-by: Minjie Du <duminjie@vivo.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Minjie Du authored and Andrew Morton committed Dec 11, 2023
1 parent 4eca0ef commit 8ff2526
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mm/filemap.c
Original file line number Diff line number Diff line change
@@ -2173,7 +2173,7 @@ unsigned filemap_get_folios_contig(struct address_space *mapping,

if (nr) {
folio = fbatch->folios[nr - 1];
*start = folio->index + folio_nr_pages(folio);
*start = folio_next_index(folio);
}
out:
rcu_read_unlock();

0 comments on commit 8ff2526

Please sign in to comment.