Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Christoph Hellwig and committed by
Andrew Morton
8d4bb46b 1aca4021

+10 -5
+10 -5
fs/ntfs3/inode.c
··· 871 871 } 872 872 873 873 static int ntfs_resident_writepage(struct folio *folio, 874 - struct writeback_control *wbc, void *data) 874 + struct writeback_control *wbc) 875 875 { 876 - struct address_space *mapping = data; 876 + struct address_space *mapping = folio->mapping; 877 877 struct inode *inode = mapping->host; 878 878 struct ntfs_inode *ni = ntfs_i(inode); 879 879 int ret; ··· 907 907 if (unlikely(ntfs3_forced_shutdown(inode->i_sb))) 908 908 return -EIO; 909 909 910 - if (is_resident(ntfs_i(inode))) 911 - return write_cache_pages(mapping, wbc, ntfs_resident_writepage, 912 - mapping); 910 + if (is_resident(ntfs_i(inode))) { 911 + struct folio *folio = NULL; 912 + int error; 913 + 914 + while ((folio = writeback_iter(mapping, wbc, folio, &error))) 915 + error = ntfs_resident_writepage(folio, wbc); 916 + return error; 917 + } 913 918 return mpage_writepages(mapping, wbc, ntfs_get_block); 914 919 } 915 920