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: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarWilliam Kucharski <william.kucharski@oracle.com>
parent 1e84a3d9
......@@ -408,6 +408,7 @@ void truncate_inode_pages_range(struct address_space *mapping,
folio_wait_writeback(folio);
truncate_inode_folio(mapping, folio);
folio_unlock(folio);
index = folio_index(folio) + folio_nr_pages(folio) - 1;
}
truncate_exceptional_pvec_entries(mapping, &pvec, indices);
pagevec_release(&pvec);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment