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

ntfs3: remove ->writepage

->writepage is a very inefficient method to write back data, and only used
through write_cache_pages or a a fallback when no ->migrate_folio method
is present.

Set ->migrate_folio to the generic buffer_head based helper, and remove
the ->writepage implementation.

Link: https://lkml.kernel.org/r/20221229161031.391878-4-hch@lst.de
Signed-off-by: Christoph Hellwig <hch@lst.de>
Cc: Jan Kara <jack@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Joseph Qi <joseph.qi@linux.alibaba.com>
Cc: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Cc: Mark Fasheh <mark@fasheh.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Christoph Hellwig and committed by
Andrew Morton
25a89826 d4428bad

+1 -21
+1 -21
fs/ntfs3/inode.c
··· 832 832 return err; 833 833 } 834 834 835 - static int ntfs_writepage(struct page *page, struct writeback_control *wbc) 836 - { 837 - struct address_space *mapping = page->mapping; 838 - struct inode *inode = mapping->host; 839 - struct ntfs_inode *ni = ntfs_i(inode); 840 - int err; 841 - 842 - if (is_resident(ni)) { 843 - ni_lock(ni); 844 - err = attr_data_write_resident(ni, page); 845 - ni_unlock(ni); 846 - if (err != E_NTFS_NONRESIDENT) { 847 - unlock_page(page); 848 - return err; 849 - } 850 - } 851 - 852 - return block_write_full_page(page, ntfs_get_block, wbc); 853 - } 854 - 855 835 static int ntfs_resident_writepage(struct page *page, 856 836 struct writeback_control *wbc, void *data) 857 837 { ··· 2063 2083 const struct address_space_operations ntfs_aops = { 2064 2084 .read_folio = ntfs_read_folio, 2065 2085 .readahead = ntfs_readahead, 2066 - .writepage = ntfs_writepage, 2067 2086 .writepages = ntfs_writepages, 2068 2087 .write_begin = ntfs_write_begin, 2069 2088 .write_end = ntfs_write_end, 2070 2089 .direct_IO = ntfs_direct_IO, 2071 2090 .bmap = ntfs_bmap, 2072 2091 .dirty_folio = block_dirty_folio, 2092 + .migrate_folio = buffer_migrate_folio, 2073 2093 .invalidate_folio = block_invalidate_folio, 2074 2094 }; 2075 2095