File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -1589,6 +1589,16 @@ int folio_wait_private_2_killable(struct folio *folio)
1589
1589
}
1590
1590
EXPORT_SYMBOL (folio_wait_private_2_killable );
1591
1591
1592
+ static void filemap_end_dropbehind (struct folio * folio )
1593
+ {
1594
+ struct address_space * mapping = folio -> mapping ;
1595
+
1596
+ VM_BUG_ON_FOLIO (!folio_test_locked (folio ), folio );
1597
+
1598
+ if (mapping && !folio_test_writeback (folio ) && !folio_test_dirty (folio ))
1599
+ folio_unmap_invalidate (mapping , folio , 0 );
1600
+ }
1601
+
1592
1602
/*
1593
1603
* If folio was marked as dropbehind, then pages should be dropped when writeback
1594
1604
* completes. Do that now. If we fail, it's likely because of a big folio -
@@ -1604,8 +1614,7 @@ static void folio_end_dropbehind_write(struct folio *folio)
1604
1614
* invalidation in that case.
1605
1615
*/
1606
1616
if (in_task () && folio_trylock (folio )) {
1607
- if (folio -> mapping )
1608
- folio_unmap_invalidate (folio -> mapping , folio , 0 );
1617
+ filemap_end_dropbehind (folio );
1609
1618
folio_unlock (folio );
1610
1619
}
1611
1620
}
You can’t perform that action at this time.
0 commit comments