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) <willy@infradead.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: William Kucharski <william.kucharski@oracle.com>
This commit is contained in:
Matthew Wilcox (Oracle) 2021-11-26 13:25:38 -05:00
Родитель 1e84a3d997
Коммит ccbbf761d4
1 изменённых файлов: 1 добавлений и 0 удалений

Просмотреть файл

@ -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);