remove ->writepage in ntfs3
Subsystems (2)
Hi Konstantin,
this small series removes the deprecated ->writepage method from ntfs3. I don't have a ntfs test setup so this is untested and should be handled with care.
Diffstat:
inode.c | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-)
PATCH 1/2 ntfs3: stop using generic_writepages
Open code the resident inode handling in ntfs_writepages by directly using write_cache_pages to prepare removing the ->writepage handler in ntfs3.
--- fs/ntfs3/inode.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-)
fs/ntfs3/inode.c +19 -2
@@ -846,12 +846,29 @@ static int ntfs_writepage(struct page *page, struct writeback_control *wbc)return block_write_full_page (page, ntfs_get_block, wbc); } +static int ntfs_resident_writepage (struct page *page, +struct writeback_control *wbc,void *data) +{ +struct address_space *mapping = data; +struct ntfs_inode *ni =ntfs_i (mapping->host); +int ret; + +ni_lock (ni); + ret =attr_data_write_resident (ni, page); +ni_unlock (ni); + +if (ret !=E_NTFS_NONRESIDENT ) +unlock_page (page); +mapping_set_error (mapping, ret); +return ret; +} +static int ntfs_writepages (struct address_space *mapping,struct writeback_control *wbc) { -/* Redirect call to 'ntfs_writepage' for resident files. */ if (is_resident (ntfs_i (mapping->host))) -return generic_writepages (mapping, wbc); +return write_cache_pages (mapping, wbc, ntfs_resident_writepage, + mapping);return mpage_writepages (mapping, wbc, ntfs_get_block); }
Signature · 1 line
2.30.2
PATCH 2/2 ntfs3: remove ->writepage
In reply to Christoph Hellwig->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.
--- fs/ntfs3/inode.c | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-)
fs/ntfs3/inode.c +1 -21
@@ -826,26 +826,6 @@ int ntfs_set_size(struct inode *inode, u64 new_size)return err; } -static int ntfs_writepage (struct page *page,struct writeback_control *wbc) -{ -struct address_space *mapping = page->mapping; -struct inode *inode = mapping->host; -struct ntfs_inode *ni =ntfs_i (inode); -int err; - -if (is_resident (ni)) { -ni_lock (ni); - err =attr_data_write_resident (ni, page); -ni_unlock (ni); -if (err !=E_NTFS_NONRESIDENT ) { -unlock_page (page); -return err; - } - } - -return block_write_full_page (page, ntfs_get_block, wbc); -} -static int ntfs_resident_writepage (struct page *page,struct writeback_control *wbc,void *data) {
@@ -1946,13 +1926,13 @@ const struct inode_operations ntfs_link_inode_operations = {const struct address_space_operations ntfs_aops = { .read_folio = ntfs_read_folio, .readahead = ntfs_readahead, - .writepage = ntfs_writepage, .writepages = ntfs_writepages, .write_begin = ntfs_write_begin, .write_end = ntfs_write_end, .direct_IO = ntfs_direct_IO, .bmap = ntfs_bmap, .dirty_folio = block_dirty_folio, + .migrate_folio = buffer_migrate_folio, .invalidate_folio = block_invalidate_folio, };
Signature · 1 line
2.30.2
Quoted 5 lines · Christoph Hellwig
Hi Konstantin,
this small series removes the deprecated ->writepage method from ntfs3. I don't have a ntfs test setup so this is untested and should be handled with care.
Did you get a chance to look into this?
Konstantin Komarov
maintainerQuoted 9 lines · Christoph Hellwig
Hi Konstantin,
this small series removes the deprecated ->writepage method from ntfs3. I don't have a ntfs test setup so this is untested and should be handled with care.
Diffstat:
inode.c | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-)
Hello Christoph,
Sorry for the delay. We have taken your patches for testing.
We will be back with an answer as soon as possible.