Remove aops->launder_folio - #1163
Open
blktests-ci[bot] wants to merge 7 commits into
Open
Conversation
added 7 commits
August 20, 2026 20:02
This is a better API for filesystems to use than invalidate_inode_pages2() / invalidate_inode_pages2_range(). However, the 'nowait' argument is unnecessary for them. It's also wrongly implemented as it will call invalidate_inode_pages2_range() even after filemap_range_has_page() returns false. Move the filemap_range_has_page() call into the two existing callers and add kernel-doc. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
FUSE relies on invalidate_inode_pages2() / invalidate_inode_pages2_range() doing writeback by calling fuse_launder_folio(). While this works, it is inefficient as each page is written back and waited for individually. Far better to call filemap_invalidate_pages() which will do a bulk write first, then remove the page cache. With this done, fuse_launder_folio() no longer needs to exist so delete it. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
btrfs relies on invalidate_inode_pages2() / invalidate_inode_pages2_range() doing writeback by calling btrfs_launder_folio(). While this works, it is inefficient as each folio is written back and waited for individually. Far better to call filemap_invalidate_pages() which will do a bulk write first, then remove the page cache. With this done, btrfs_launder_folio() no longer needs to exist so delete it. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
nfs relies on invalidate_inode_pages2() / invalidate_inode_pages2_range() doing writeback by calling nfs_launder_folio(). While this works, it is inefficient as each folio is written back and waited for individually. Far better to call filemap_invalidate_pages() which will do a bulk write first, then remove the page cache. With this done, nfs_launder_folio() no longer needs to exist so delete it. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
This pair of calls simply open-codes Use filemap_invalidate_pages(), so convert it. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
There doesn't seem to be a good reason to implement ->launder_folio in orangefs. Leave orangefs_launder_folio() alone as it is used in several places and removing it entirely would be tricky. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
When we do direct I/O, we need to evict any page cache that overlaps the range in the file. First we write back any dirty folios in the range, then we lock each folio and remove it from the CPU page tables. This leaves a wide window for userspace to re-dirty the folio by storing to a shared writable mmap. Many filesystems respond to this situation by failing the call to release_folio(), but some try to writeback the dirty folio again, formerly in their release_folio() method and now in their launder_folio() method. Remove this inconsistency between filesystems by checking whether the folio is dirty in the VFS and failing the call to folio_unmap_invalidate(). Since we hold the folio locked and unmapped at this time, there is no way to dirty the folio after this point. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Author
|
Upstream branch: bd5f485 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull request for series with
subject: Remove aops->launder_folio
version: 1
url: https://patchwork.kernel.org/project/linux-block/list/?series=1149291