]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
ntfs3: stop using write_cache_pages
authorChristoph Hellwig <hch@lst.de>
Mon, 18 Aug 2025 06:10:08 +0000 (08:10 +0200)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 12 Sep 2025 00:25:13 +0000 (17:25 -0700)
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>
fs/ntfs3/inode.c

index 37cbbee7fa580df0f979de7762858a9f71d82cda..48b4f73a93ee9e602ea25af757aec0555860e80f 100644 (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);
 }