]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
bcachefs: stop using write_cache_pages
authorChristoph Hellwig <hch@lst.de>
Mon, 18 Aug 2025 06:10:09 +0000 (08:10 +0200)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 12 Sep 2025 00:25:14 +0000 (17:25 -0700)
Stop using the obsolete write_cache_pages and use writeback_iter directly.
This basically just open codes write_cache_pages without the indirect
call, but there's probably ways to structure the code even nicer as a
follow on.

Link: https://lkml.kernel.org/r/20250818061017.1526853-3-hch@lst.de
Signed-off-by: Christoph Hellwig <hch@lst.de>
Cc: David Hildenbrand <david@redhat.com>
Cc: Kent Overstreet <kent.overstreet@linux.dev>
Cc: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/bcachefs/fs-io-buffered.c

index 1c54b9b5bd695354d11e9afd62990310b430000a..fdeaa25189f2182beb55826c4872a1f938ccb117 100644 (file)
@@ -655,6 +655,17 @@ do_io:
        return 0;
 }
 
+static int bch2_write_cache_pages(struct address_space *mapping,
+                     struct writeback_control *wbc, void *data)
+{
+       struct folio *folio = NULL;
+       int error;
+
+       while ((folio = writeback_iter(mapping, wbc, folio, &error)))
+               error = __bch2_writepage(folio, wbc, data);
+       return error;
+}
+
 int bch2_writepages(struct address_space *mapping, struct writeback_control *wbc)
 {
        struct bch_fs *c = mapping->host->i_sb->s_fs_info;
@@ -663,7 +674,7 @@ int bch2_writepages(struct address_space *mapping, struct writeback_control *wbc
        bch2_inode_opts_get(&w->opts, c, &to_bch_ei(mapping->host)->ei_inode);
 
        blk_start_plug(&w->plug);
-       int ret = write_cache_pages(mapping, wbc, __bch2_writepage, w);
+       int ret = bch2_write_cache_pages(mapping, wbc, w);
        if (w->io)
                bch2_writepage_do_io(w);
        blk_finish_plug(&w->plug);