summaryrefslogtreecommitdiffstats
path: root/mm/truncate.c
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2021-05-20 14:17:44 +0200
committerMatthew Wilcox (Oracle) <willy@infradead.org>2022-01-08 06:28:41 +0100
commitf6357c3a9d3ea5a00c5bf52845b633d649da6722 (patch)
treebc7ee8f208669a1195504f8953fbf5ae3dab6592 /mm/truncate.c
parentfs: Convert vfs_dedupe_file_range_compare to folios (diff)
downloadlinux-f6357c3a9d3ea5a00c5bf52845b633d649da6722.tar.xz
linux-f6357c3a9d3ea5a00c5bf52845b633d649da6722.zip
truncate: Convert invalidate_inode_pages2_range to folios
If we're going to unmap a folio, we have to be sure to unmap the entire folio, not just the part of it which lies after the search index. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: William Kucharski <william.kucharski@oracle.com>
Diffstat (limited to 'mm/truncate.c')
-rw-r--r--mm/truncate.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/mm/truncate.c b/mm/truncate.c
index a1113b0abb30..2d1dae085acb 100644
--- a/mm/truncate.c
+++ b/mm/truncate.c
@@ -599,13 +599,13 @@ failed:
return 0;
}
-static int do_launder_page(struct address_space *mapping, struct page *page)
+static int do_launder_folio(struct address_space *mapping, struct folio *folio)
{
- if (!PageDirty(page))
+ if (!folio_test_dirty(folio))
return 0;
- if (page->mapping != mapping || mapping->a_ops->launder_page == NULL)
+ if (folio->mapping != mapping || mapping->a_ops->launder_page == NULL)
return 0;
- return mapping->a_ops->launder_page(page);
+ return mapping->a_ops->launder_page(&folio->page);
}
/**
@@ -671,7 +671,7 @@ int invalidate_inode_pages2_range(struct address_space *mapping,
unmap_mapping_folio(folio);
BUG_ON(folio_mapped(folio));
- ret2 = do_launder_page(mapping, &folio->page);
+ ret2 = do_launder_folio(mapping, folio);
if (ret2 == 0) {
if (!invalidate_complete_folio2(mapping, folio))
ret2 = -EBUSY;