From b9a8a4195c7d3a51235a4fc974a46ad4e9689ffd Mon Sep 17 00:00:00 2001 From: "Matthew Wilcox (Oracle)" Date: Wed, 27 May 2020 17:59:22 -0400 Subject: truncate,shmem: Handle truncates that split large folios Handle folio splitting in the parts of the truncation functions which already handle partial pages. Factor all that code out into a new function called truncate_inode_partial_folio(). Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Jan Kara Reviewed-by: William Kucharski --- mm/internal.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'mm/internal.h') diff --git a/mm/internal.h b/mm/internal.h index c52c05dc6b1f..26af8a5a5be3 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -98,6 +98,8 @@ unsigned find_get_entries(struct address_space *mapping, pgoff_t start, pgoff_t end, struct folio_batch *fbatch, pgoff_t *indices); void filemap_free_folio(struct address_space *mapping, struct folio *folio); int truncate_inode_folio(struct address_space *mapping, struct folio *folio); +bool truncate_inode_partial_folio(struct folio *folio, loff_t start, + loff_t end); /** * folio_evictable - Test whether a folio is evictable. -- cgit v1.2.3