Skip to content

Commit ccbbf76

Browse files
author
Matthew Wilcox (Oracle)
committed
truncate: Skip known-truncated indices
If we've truncated an entire folio, we can skip over all the indices covered by this folio. Signed-off-by: Matthew Wilcox (Oracle) <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: William Kucharski <[email protected]>
1 parent 1e84a3d commit ccbbf76

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

mm/truncate.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,7 @@ void truncate_inode_pages_range(struct address_space *mapping,
408408
folio_wait_writeback(folio);
409409
truncate_inode_folio(mapping, folio);
410410
folio_unlock(folio);
411+
index = folio_index(folio) + folio_nr_pages(folio) - 1;
411412
}
412413
truncate_exceptional_pvec_entries(mapping, &pvec, indices);
413414
pagevec_release(&pvec);

0 commit comments

Comments
 (0)