diff options
author | Sidhartha Kumar <sidhartha.kumar@oracle.com> | 2023-06-27 20:43:49 +0300 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2023-08-18 20:12:00 +0300 |
commit | 87b11f862254396a93636f0998377ac3f6648f5f (patch) | |
tree | 8e866e480d9533017b93efbb1ec46fc9225f503a /mm/truncate.c | |
parent | 3a29280afb25263c76212a8c140c29f280049ffb (diff) | |
download | linux-87b11f862254396a93636f0998377ac3f6648f5f.tar.xz |
mm: increase usage of folio_next_index() helper
Simplify code pattern of 'folio->index + folio_nr_pages(folio)' by using
the existing helper folio_next_index().
Link: https://lkml.kernel.org/r/20230627174349.491803-1-sidhartha.kumar@oracle.com
Signed-off-by: Sidhartha Kumar <sidhartha.kumar@oracle.com>
Suggested-by: Christoph Hellwig <hch@infradead.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Cc: Andreas Dilger <adilger.kernel@dilger.ca>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Hugh Dickins <hughd@google.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/truncate.c')
-rw-r--r-- | mm/truncate.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/truncate.c b/mm/truncate.c index 95d1291d269b..2f28cc0e12ef 100644 --- a/mm/truncate.c +++ b/mm/truncate.c @@ -378,7 +378,7 @@ void truncate_inode_pages_range(struct address_space *mapping, if (!IS_ERR(folio)) { same_folio = lend < folio_pos(folio) + folio_size(folio); if (!truncate_inode_partial_folio(folio, lstart, lend)) { - start = folio->index + folio_nr_pages(folio); + start = folio_next_index(folio); if (same_folio) end = folio->index; } |