ntfs3: stop using write_cache_pages

Patch series "remove write_cache_pages()".

Kill off write_cache_pages() after converting the last two users to the
iterator.


This patch (of 3):

Stop using the obsolete write_cache_pages and use writeback_iter directly.

Link: https://lkml.kernel.org/r/20250818061017.1526853-1-hch@lst.de
Link: https://lkml.kernel.org/r/20250818061017.1526853-2-hch@lst.de
Signed-off-by: Christoph Hellwig <hch@lst.de>
Cc: Kent Overstreet <kent.overstreet@linux.dev>
Cc: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: David Hildenbrand <david@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
Christoph Hellwig 2025-08-18 08:10:08 +02:00 committed by Andrew Morton
parent 1aca4021f8
commit 8d4bb46ba7
1 changed files with 10 additions and 5 deletions

View File

@ -871,9 +871,9 @@ out:
}
static int ntfs_resident_writepage(struct folio *folio,
struct writeback_control *wbc, void *data)
struct writeback_control *wbc)
{
struct address_space *mapping = data;
struct address_space *mapping = folio->mapping;
struct inode *inode = mapping->host;
struct ntfs_inode *ni = ntfs_i(inode);
int ret;
@ -907,9 +907,14 @@ static int ntfs_writepages(struct address_space *mapping,
if (unlikely(ntfs3_forced_shutdown(inode->i_sb)))
return -EIO;
if (is_resident(ntfs_i(inode)))
return write_cache_pages(mapping, wbc, ntfs_resident_writepage,
mapping);
if (is_resident(ntfs_i(inode))) {
struct folio *folio = NULL;
int error;
while ((folio = writeback_iter(mapping, wbc, folio, &error)))
error = ntfs_resident_writepage(folio, wbc);
return error;
}
return mpage_writepages(mapping, wbc, ntfs_get_block);
}