diff options
author | Matthew Wilcox (Oracle) <willy@infradead.org> | 2021-06-29 04:36:18 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2021-06-29 19:53:48 +0200 |
commit | 2f18be363c3332dedaabb9fc050a282a00f4f646 (patch) | |
tree | 77d90b7a9350a235ce4ffa74ad32e3c436cb2a9d /mm/page-writeback.c | |
parent | mm/writeback: move __set_page_dirty() to core mm (diff) | |
download | linux-2f18be363c3332dedaabb9fc050a282a00f4f646.tar.xz linux-2f18be363c3332dedaabb9fc050a282a00f4f646.zip |
mm/writeback: use __set_page_dirty in __set_page_dirty_nobuffers
This is fundamentally the same code, so just call it instead of
duplicating it.
Link: https://lkml.kernel.org/r/20210615162342.1669332-3-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Jan Kara <jack@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/page-writeback.c')
-rw-r--r-- | mm/page-writeback.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/mm/page-writeback.c b/mm/page-writeback.c index 1345882c428b..8bd69dc5379a 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c @@ -2508,20 +2508,12 @@ int __set_page_dirty_nobuffers(struct page *page) lock_page_memcg(page); if (!TestSetPageDirty(page)) { struct address_space *mapping = page_mapping(page); - unsigned long flags; if (!mapping) { unlock_page_memcg(page); return 1; } - - xa_lock_irqsave(&mapping->i_pages, flags); - BUG_ON(page_mapping(page) != mapping); - WARN_ON_ONCE(!PagePrivate(page) && !PageUptodate(page)); - account_page_dirtied(page, mapping); - __xa_set_mark(&mapping->i_pages, page_index(page), - PAGECACHE_TAG_DIRTY); - xa_unlock_irqrestore(&mapping->i_pages, flags); + __set_page_dirty(page, mapping, !PagePrivate(page)); unlock_page_memcg(page); if (mapping->host) { |