Skip to content

Commit f6357c3

Browse files
author
Matthew Wilcox (Oracle)
committed
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) <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: William Kucharski <[email protected]>
1 parent 338f379 commit f6357c3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

mm/truncate.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -599,13 +599,13 @@ static int invalidate_complete_folio2(struct address_space *mapping,
599599
return 0;
600600
}
601601

602-
static int do_launder_page(struct address_space *mapping, struct page *page)
602+
static int do_launder_folio(struct address_space *mapping, struct folio *folio)
603603
{
604-
if (!PageDirty(page))
604+
if (!folio_test_dirty(folio))
605605
return 0;
606-
if (page->mapping != mapping || mapping->a_ops->launder_page == NULL)
606+
if (folio->mapping != mapping || mapping->a_ops->launder_page == NULL)
607607
return 0;
608-
return mapping->a_ops->launder_page(page);
608+
return mapping->a_ops->launder_page(&folio->page);
609609
}
610610

611611
/**
@@ -671,7 +671,7 @@ int invalidate_inode_pages2_range(struct address_space *mapping,
671671
unmap_mapping_folio(folio);
672672
BUG_ON(folio_mapped(folio));
673673

674-
ret2 = do_launder_page(mapping, &folio->page);
674+
ret2 = do_launder_folio(mapping, folio);
675675
if (ret2 == 0) {
676676
if (!invalidate_complete_folio2(mapping, folio))
677677
ret2 = -EBUSY;

0 commit comments

Comments
 (0)