fs: Convert trivial uses of __set_page_dirty_nobuffers to filemap_dirty_folio

These filesystems use __set_page_dirty_nobuffers() either directly or
with a very thin wrapper; convert them en masse.
Signed-off-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
Tested-by: default avatarDamien Le Moal <damien.lemoal@opensource.wdc.com>
Acked-by: default avatarDamien Le Moal <damien.lemoal@opensource.wdc.com>
Tested-by: Mike Marshall <hubcap@omnibond.com> # orangefs
Tested-by: David Howells <dhowells@redhat.com> # afs
parent 0079c3b1
...@@ -10077,11 +10077,6 @@ int btrfs_prealloc_file_range_trans(struct inode *inode, ...@@ -10077,11 +10077,6 @@ int btrfs_prealloc_file_range_trans(struct inode *inode,
min_size, actual_len, alloc_hint, trans); min_size, actual_len, alloc_hint, trans);
} }
static int btrfs_set_page_dirty(struct page *page)
{
return __set_page_dirty_nobuffers(page);
}
static int btrfs_permission(struct user_namespace *mnt_userns, static int btrfs_permission(struct user_namespace *mnt_userns,
struct inode *inode, int mask) struct inode *inode, int mask)
{ {
...@@ -10644,7 +10639,7 @@ static const struct address_space_operations btrfs_aops = { ...@@ -10644,7 +10639,7 @@ static const struct address_space_operations btrfs_aops = {
#ifdef CONFIG_MIGRATION #ifdef CONFIG_MIGRATION
.migratepage = btrfs_migratepage, .migratepage = btrfs_migratepage,
#endif #endif
.set_page_dirty = btrfs_set_page_dirty, .dirty_folio = filemap_dirty_folio,
.error_remove_page = generic_error_remove_page, .error_remove_page = generic_error_remove_page,
.swap_activate = btrfs_swap_activate, .swap_activate = btrfs_swap_activate,
.swap_deactivate = btrfs_swap_deactivate, .swap_deactivate = btrfs_swap_deactivate,
......
...@@ -3541,22 +3541,23 @@ const struct iomap_ops ext4_iomap_report_ops = { ...@@ -3541,22 +3541,23 @@ const struct iomap_ops ext4_iomap_report_ops = {
}; };
/* /*
* Pages can be marked dirty completely asynchronously from ext4's journalling * Folios can be marked dirty completely asynchronously from ext4's
* activity. By filemap_sync_pte(), try_to_unmap_one(), etc. We cannot do * journalling activity. By filemap_sync_pte(), try_to_unmap_one(), etc.
* much here because ->set_page_dirty is called under VFS locks. The page is * We cannot do much here because ->dirty_folio may be called with the
* not necessarily locked. * page table lock held. The folio is not necessarily locked.
* *
* We cannot just dirty the page and leave attached buffers clean, because the * We cannot just dirty the folio and leave attached buffers clean, because the
* buffers' dirty state is "definitive". We cannot just set the buffers dirty * buffers' dirty state is "definitive". We cannot just set the buffers dirty
* or jbddirty because all the journalling code will explode. * or jbddirty because all the journalling code will explode.
* *
* So what we do is to mark the page "pending dirty" and next time writepage * So what we do is to mark the folio "pending dirty" and next time writepage
* is called, propagate that into the buffers appropriately. * is called, propagate that into the buffers appropriately.
*/ */
static int ext4_journalled_set_page_dirty(struct page *page) static bool ext4_journalled_dirty_folio(struct address_space *mapping,
struct folio *folio)
{ {
SetPageChecked(page); folio_set_checked(folio);
return __set_page_dirty_nobuffers(page); return filemap_dirty_folio(mapping, folio);
} }
static int ext4_set_page_dirty(struct page *page) static int ext4_set_page_dirty(struct page *page)
...@@ -3598,7 +3599,7 @@ static const struct address_space_operations ext4_journalled_aops = { ...@@ -3598,7 +3599,7 @@ static const struct address_space_operations ext4_journalled_aops = {
.writepages = ext4_writepages, .writepages = ext4_writepages,
.write_begin = ext4_write_begin, .write_begin = ext4_write_begin,
.write_end = ext4_journalled_write_end, .write_end = ext4_journalled_write_end,
.set_page_dirty = ext4_journalled_set_page_dirty, .dirty_folio = ext4_journalled_dirty_folio,
.bmap = ext4_bmap, .bmap = ext4_bmap,
.invalidate_folio = ext4_journalled_invalidate_folio, .invalidate_folio = ext4_journalled_invalidate_folio,
.releasepage = ext4_releasepage, .releasepage = ext4_releasepage,
......
...@@ -3162,7 +3162,7 @@ static const struct address_space_operations fuse_file_aops = { ...@@ -3162,7 +3162,7 @@ static const struct address_space_operations fuse_file_aops = {
.writepage = fuse_writepage, .writepage = fuse_writepage,
.writepages = fuse_writepages, .writepages = fuse_writepages,
.launder_folio = fuse_launder_folio, .launder_folio = fuse_launder_folio,
.set_page_dirty = __set_page_dirty_nobuffers, .dirty_folio = filemap_dirty_folio,
.bmap = fuse_bmap, .bmap = fuse_bmap,
.direct_IO = fuse_direct_IO, .direct_IO = fuse_direct_IO,
.write_begin = fuse_write_begin, .write_begin = fuse_write_begin,
......
...@@ -780,7 +780,7 @@ static const struct address_space_operations gfs2_aops = { ...@@ -780,7 +780,7 @@ static const struct address_space_operations gfs2_aops = {
.writepages = gfs2_writepages, .writepages = gfs2_writepages,
.readpage = gfs2_readpage, .readpage = gfs2_readpage,
.readahead = gfs2_readahead, .readahead = gfs2_readahead,
.set_page_dirty = __set_page_dirty_nobuffers, .dirty_folio = filemap_dirty_folio,
.releasepage = iomap_releasepage, .releasepage = iomap_releasepage,
.invalidate_folio = iomap_invalidate_folio, .invalidate_folio = iomap_invalidate_folio,
.bmap = gfs2_bmap, .bmap = gfs2_bmap,
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include <linux/statfs.h> #include <linux/statfs.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <linux/writeback.h>
#include <linux/mount.h> #include <linux/mount.h>
#include <linux/namei.h> #include <linux/namei.h>
#include "hostfs.h" #include "hostfs.h"
...@@ -504,7 +505,7 @@ static int hostfs_write_end(struct file *file, struct address_space *mapping, ...@@ -504,7 +505,7 @@ static int hostfs_write_end(struct file *file, struct address_space *mapping,
static const struct address_space_operations hostfs_aops = { static const struct address_space_operations hostfs_aops = {
.writepage = hostfs_writepage, .writepage = hostfs_writepage,
.readpage = hostfs_readpage, .readpage = hostfs_readpage,
.set_page_dirty = __set_page_dirty_nobuffers, .dirty_folio = filemap_dirty_folio,
.write_begin = hostfs_write_begin, .write_begin = hostfs_write_begin,
.write_end = hostfs_write_end, .write_end = hostfs_write_end,
}; };
......
...@@ -570,7 +570,7 @@ const struct address_space_operations jfs_metapage_aops = { ...@@ -570,7 +570,7 @@ const struct address_space_operations jfs_metapage_aops = {
.writepage = metapage_writepage, .writepage = metapage_writepage,
.releasepage = metapage_releasepage, .releasepage = metapage_releasepage,
.invalidate_folio = metapage_invalidate_folio, .invalidate_folio = metapage_invalidate_folio,
.set_page_dirty = __set_page_dirty_nobuffers, .dirty_folio = filemap_dirty_folio,
}; };
struct metapage *__get_metapage(struct inode *inode, unsigned long lblock, struct metapage *__get_metapage(struct inode *inode, unsigned long lblock,
......
...@@ -515,7 +515,7 @@ static void nfs_swap_deactivate(struct file *file) ...@@ -515,7 +515,7 @@ static void nfs_swap_deactivate(struct file *file)
const struct address_space_operations nfs_file_aops = { const struct address_space_operations nfs_file_aops = {
.readpage = nfs_readpage, .readpage = nfs_readpage,
.readpages = nfs_readpages, .readpages = nfs_readpages,
.set_page_dirty = __set_page_dirty_nobuffers, .dirty_folio = filemap_dirty_folio,
.writepage = nfs_writepage, .writepage = nfs_writepage,
.writepages = nfs_writepages, .writepages = nfs_writepages,
.write_begin = nfs_write_begin, .write_begin = nfs_write_begin,
......
...@@ -1684,9 +1684,7 @@ const struct address_space_operations ntfs_mst_aops = { ...@@ -1684,9 +1684,7 @@ const struct address_space_operations ntfs_mst_aops = {
.readpage = ntfs_readpage, /* Fill page with data. */ .readpage = ntfs_readpage, /* Fill page with data. */
#ifdef NTFS_RW #ifdef NTFS_RW
.writepage = ntfs_writepage, /* Write dirty page to disk. */ .writepage = ntfs_writepage, /* Write dirty page to disk. */
.set_page_dirty = __set_page_dirty_nobuffers, /* Set the page dirty .dirty_folio = filemap_dirty_folio,
without touching the buffers
belonging to the page. */
#endif /* NTFS_RW */ #endif /* NTFS_RW */
.migratepage = buffer_migrate_page, .migratepage = buffer_migrate_page,
.is_partially_uptodate = block_is_partially_uptodate, .is_partially_uptodate = block_is_partially_uptodate,
......
...@@ -634,7 +634,7 @@ static const struct address_space_operations orangefs_address_operations = { ...@@ -634,7 +634,7 @@ static const struct address_space_operations orangefs_address_operations = {
.readahead = orangefs_readahead, .readahead = orangefs_readahead,
.readpage = orangefs_readpage, .readpage = orangefs_readpage,
.writepages = orangefs_writepages, .writepages = orangefs_writepages,
.set_page_dirty = __set_page_dirty_nobuffers, .dirty_folio = filemap_dirty_folio,
.write_begin = orangefs_write_begin, .write_begin = orangefs_write_begin,
.write_end = orangefs_write_end, .write_end = orangefs_write_end,
.invalidate_folio = orangefs_invalidate_folio, .invalidate_folio = orangefs_invalidate_folio,
......
...@@ -354,7 +354,7 @@ static int vboxsf_write_end(struct file *file, struct address_space *mapping, ...@@ -354,7 +354,7 @@ static int vboxsf_write_end(struct file *file, struct address_space *mapping,
const struct address_space_operations vboxsf_reg_aops = { const struct address_space_operations vboxsf_reg_aops = {
.readpage = vboxsf_readpage, .readpage = vboxsf_readpage,
.writepage = vboxsf_writepage, .writepage = vboxsf_writepage,
.set_page_dirty = __set_page_dirty_nobuffers, .dirty_folio = filemap_dirty_folio,
.write_begin = simple_write_begin, .write_begin = simple_write_begin,
.write_end = vboxsf_write_end, .write_end = vboxsf_write_end,
}; };
......
...@@ -567,7 +567,7 @@ const struct address_space_operations xfs_address_space_operations = { ...@@ -567,7 +567,7 @@ const struct address_space_operations xfs_address_space_operations = {
.readpage = xfs_vm_readpage, .readpage = xfs_vm_readpage,
.readahead = xfs_vm_readahead, .readahead = xfs_vm_readahead,
.writepages = xfs_vm_writepages, .writepages = xfs_vm_writepages,
.set_page_dirty = __set_page_dirty_nobuffers, .dirty_folio = filemap_dirty_folio,
.releasepage = iomap_releasepage, .releasepage = iomap_releasepage,
.invalidate_folio = iomap_invalidate_folio, .invalidate_folio = iomap_invalidate_folio,
.bmap = xfs_vm_bmap, .bmap = xfs_vm_bmap,
......
...@@ -185,7 +185,7 @@ static const struct address_space_operations zonefs_file_aops = { ...@@ -185,7 +185,7 @@ static const struct address_space_operations zonefs_file_aops = {
.readahead = zonefs_readahead, .readahead = zonefs_readahead,
.writepage = zonefs_writepage, .writepage = zonefs_writepage,
.writepages = zonefs_writepages, .writepages = zonefs_writepages,
.set_page_dirty = __set_page_dirty_nobuffers, .dirty_folio = filemap_dirty_folio,
.releasepage = iomap_releasepage, .releasepage = iomap_releasepage,
.invalidate_folio = iomap_invalidate_folio, .invalidate_folio = iomap_invalidate_folio,
.migratepage = iomap_migrate_page, .migratepage = iomap_migrate_page,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment