Commit b82a96c9 authored by Matthew Wilcox (Oracle)'s avatar Matthew Wilcox (Oracle) Committed by Linus Torvalds

fs: remove noop_set_page_dirty()

Use __set_page_dirty_no_writeback() instead.  This will set the dirty bit
on the page, which will be used to avoid calling set_page_dirty() in the
future.  It will have no effect on actually writing the page back, as the
pages are not on any LRU lists.

[akpm@linux-foundation.org: export __set_page_dirty_no_writeback() to modules]

Link: https://lkml.kernel.org/r/20210615162342.1669332-6-willy@infradead.orgSigned-off-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jan Kara <jack@suse.cz>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent fc50eee3
...@@ -337,7 +337,7 @@ static unsigned long dax_get_unmapped_area(struct file *filp, ...@@ -337,7 +337,7 @@ static unsigned long dax_get_unmapped_area(struct file *filp,
} }
static const struct address_space_operations dev_dax_aops = { static const struct address_space_operations dev_dax_aops = {
.set_page_dirty = noop_set_page_dirty, .set_page_dirty = __set_page_dirty_no_writeback,
.invalidatepage = noop_invalidatepage, .invalidatepage = noop_invalidatepage,
}; };
......
...@@ -992,7 +992,7 @@ const struct address_space_operations ext2_nobh_aops = { ...@@ -992,7 +992,7 @@ const struct address_space_operations ext2_nobh_aops = {
static const struct address_space_operations ext2_dax_aops = { static const struct address_space_operations ext2_dax_aops = {
.writepages = ext2_dax_writepages, .writepages = ext2_dax_writepages,
.direct_IO = noop_direct_IO, .direct_IO = noop_direct_IO,
.set_page_dirty = noop_set_page_dirty, .set_page_dirty = __set_page_dirty_no_writeback,
.invalidatepage = noop_invalidatepage, .invalidatepage = noop_invalidatepage,
}; };
......
...@@ -3701,7 +3701,7 @@ static const struct address_space_operations ext4_da_aops = { ...@@ -3701,7 +3701,7 @@ static const struct address_space_operations ext4_da_aops = {
static const struct address_space_operations ext4_dax_aops = { static const struct address_space_operations ext4_dax_aops = {
.writepages = ext4_dax_writepages, .writepages = ext4_dax_writepages,
.direct_IO = noop_direct_IO, .direct_IO = noop_direct_IO,
.set_page_dirty = noop_set_page_dirty, .set_page_dirty = __set_page_dirty_no_writeback,
.bmap = ext4_bmap, .bmap = ext4_bmap,
.invalidatepage = noop_invalidatepage, .invalidatepage = noop_invalidatepage,
.swap_activate = ext4_iomap_swap_activate, .swap_activate = ext4_iomap_swap_activate,
......
...@@ -1329,7 +1329,7 @@ bool fuse_dax_inode_alloc(struct super_block *sb, struct fuse_inode *fi) ...@@ -1329,7 +1329,7 @@ bool fuse_dax_inode_alloc(struct super_block *sb, struct fuse_inode *fi)
static const struct address_space_operations fuse_dax_file_aops = { static const struct address_space_operations fuse_dax_file_aops = {
.writepages = fuse_dax_writepages, .writepages = fuse_dax_writepages,
.direct_IO = noop_direct_IO, .direct_IO = noop_direct_IO,
.set_page_dirty = noop_set_page_dirty, .set_page_dirty = __set_page_dirty_no_writeback,
.invalidatepage = noop_invalidatepage, .invalidatepage = noop_invalidatepage,
}; };
......
...@@ -1171,22 +1171,6 @@ int noop_fsync(struct file *file, loff_t start, loff_t end, int datasync) ...@@ -1171,22 +1171,6 @@ int noop_fsync(struct file *file, loff_t start, loff_t end, int datasync)
} }
EXPORT_SYMBOL(noop_fsync); EXPORT_SYMBOL(noop_fsync);
int noop_set_page_dirty(struct page *page)
{
/*
* Unlike __set_page_dirty_no_writeback that handles dirty page
* tracking in the page object, dax does all dirty tracking in
* the inode address_space in response to mkwrite faults. In the
* dax case we only need to worry about potentially dirty CPU
* caches, not dirty page cache pages to write back.
*
* This callback is defined to prevent fallback to
* __set_page_dirty_buffers() in set_page_dirty().
*/
return 0;
}
EXPORT_SYMBOL_GPL(noop_set_page_dirty);
void noop_invalidatepage(struct page *page, unsigned int offset, void noop_invalidatepage(struct page *page, unsigned int offset,
unsigned int length) unsigned int length)
{ {
......
...@@ -575,7 +575,7 @@ const struct address_space_operations xfs_address_space_operations = { ...@@ -575,7 +575,7 @@ const struct address_space_operations xfs_address_space_operations = {
const struct address_space_operations xfs_dax_aops = { const struct address_space_operations xfs_dax_aops = {
.writepages = xfs_dax_writepages, .writepages = xfs_dax_writepages,
.direct_IO = noop_direct_IO, .direct_IO = noop_direct_IO,
.set_page_dirty = noop_set_page_dirty, .set_page_dirty = __set_page_dirty_no_writeback,
.invalidatepage = noop_invalidatepage, .invalidatepage = noop_invalidatepage,
.swap_activate = xfs_iomap_swapfile_activate, .swap_activate = xfs_iomap_swapfile_activate,
}; };
...@@ -3417,7 +3417,6 @@ extern int simple_rename(struct user_namespace *, struct inode *, ...@@ -3417,7 +3417,6 @@ extern int simple_rename(struct user_namespace *, struct inode *,
extern void simple_recursive_removal(struct dentry *, extern void simple_recursive_removal(struct dentry *,
void (*callback)(struct dentry *)); void (*callback)(struct dentry *));
extern int noop_fsync(struct file *, loff_t, loff_t, int); extern int noop_fsync(struct file *, loff_t, loff_t, int);
extern int noop_set_page_dirty(struct page *page);
extern void noop_invalidatepage(struct page *page, unsigned int offset, extern void noop_invalidatepage(struct page *page, unsigned int offset,
unsigned int length); unsigned int length);
extern ssize_t noop_direct_IO(struct kiocb *iocb, struct iov_iter *iter); extern ssize_t noop_direct_IO(struct kiocb *iocb, struct iov_iter *iter);
......
...@@ -2417,6 +2417,7 @@ int __set_page_dirty_no_writeback(struct page *page) ...@@ -2417,6 +2417,7 @@ int __set_page_dirty_no_writeback(struct page *page)
return !TestSetPageDirty(page); return !TestSetPageDirty(page);
return 0; return 0;
} }
EXPORT_SYMBOL(__set_page_dirty_no_writeback);
/* /*
* Helper function for set_page_dirty family. * Helper function for set_page_dirty family.
......
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