]> git.proxmox.com Git - mirror_ubuntu-kernels.git/blobdiff - fs/ntfs3/inode.c
ntfs3: remove ->writepage
[mirror_ubuntu-kernels.git] / fs / ntfs3 / inode.c
index 20b953871574b859ff908fab4b307559bc87de90..6b50b6e3237876d5c12fc93d6a15250beb1fb9c0 100644 (file)
@@ -832,32 +832,29 @@ out:
        return err;
 }
 
-static int ntfs_writepage(struct page *page, struct writeback_control *wbc)
+static int ntfs_resident_writepage(struct page *page,
+               struct writeback_control *wbc, void *data)
 {
-       struct address_space *mapping = page->mapping;
-       struct inode *inode = mapping->host;
-       struct ntfs_inode *ni = ntfs_i(inode);
-       int err;
+       struct address_space *mapping = data;
+       struct ntfs_inode *ni = ntfs_i(mapping->host);
+       int ret;
 
-       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;
-               }
-       }
+       ni_lock(ni);
+       ret = attr_data_write_resident(ni, page);
+       ni_unlock(ni);
 
-       return block_write_full_page(page, ntfs_get_block, wbc);
+       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);
 }
 
@@ -2066,13 +2063,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,
 };