summaryrefslogtreecommitdiffstats
path: root/mm/truncate.c
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2022-02-12 17:39:10 -0500
committerMatthew Wilcox (Oracle) <willy@infradead.org>2022-03-21 12:59:01 -0400
commit4418481396b2caeded6d0eed11ac9052ab4c0763 (patch)
tree54f959056fc58d66ac3d7d90e83779e5b8da78e2 /mm/truncate.c
parent1b8ddbeeb9b819e62b7190115023ce858a159f5c (diff)
downloadlinux-stable-4418481396b2caeded6d0eed11ac9052ab4c0763.tar.gz
linux-stable-4418481396b2caeded6d0eed11ac9052ab4c0763.tar.bz2
linux-stable-4418481396b2caeded6d0eed11ac9052ab4c0763.zip
mm/truncate: Convert invalidate_inode_page() to use a folio
This saves a number of calls to compound_head(). Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Miaohe Lin <linmiaohe@huawei.com>
Diffstat (limited to 'mm/truncate.c')
-rw-r--r--mm/truncate.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/mm/truncate.c b/mm/truncate.c
index e5e2edaa0b76..b73c30c95cd0 100644
--- a/mm/truncate.c
+++ b/mm/truncate.c
@@ -281,14 +281,15 @@ EXPORT_SYMBOL(generic_error_remove_page);
*/
int invalidate_inode_page(struct page *page)
{
- struct address_space *mapping = page_mapping(page);
+ struct folio *folio = page_folio(page);
+ struct address_space *mapping = folio_mapping(folio);
if (!mapping)
return 0;
- if (PageDirty(page) || PageWriteback(page))
+ if (folio_test_dirty(folio) || folio_test_writeback(folio))
return 0;
if (page_mapped(page))
return 0;
- if (page_has_private(page) && !try_to_release_page(page, 0))
+ if (folio_has_private(folio) && !filemap_release_folio(folio, 0))
return 0;
return remove_mapping(mapping, page);