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

fs: remove anon_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.

Link: https://lkml.kernel.org/r/20210615162342.1669332-5-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jan Kara <jack@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Matthew Wilcox (Oracle) and committed by
Linus Torvalds
fc50eee3 fd7353f8

+1 -10
+1 -10
fs/libfs.c
··· 1217 1217 } 1218 1218 EXPORT_SYMBOL(kfree_link); 1219 1219 1220 - /* 1221 - * nop .set_page_dirty method so that people can use .page_mkwrite on 1222 - * anon inodes. 1223 - */ 1224 - static int anon_set_page_dirty(struct page *page) 1225 - { 1226 - return 0; 1227 - }; 1228 - 1229 1220 struct inode *alloc_anon_inode(struct super_block *s) 1230 1221 { 1231 1222 static const struct address_space_operations anon_aops = { 1232 - .set_page_dirty = anon_set_page_dirty, 1223 + .set_page_dirty = __set_page_dirty_no_writeback, 1233 1224 }; 1234 1225 struct inode *inode = new_inode_pseudo(s); 1235 1226