All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Matthew Wilcox (Oracle)" <willy@infradead.org>
To: Christoph Hellwig <hch@lst.de>,
	Andrew Morton <akpm@linux-foundation.org>,
	Jan Kara <jack@suse.cz>, Al Viro <viro@zeniv.linux.org.uk>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-mm@kvack.org, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org
Cc: "Matthew Wilcox (Oracle)" <willy@infradead.org>
Subject: [PATCH 2/6] mm/writeback: Use __set_page_dirty in __set_page_dirty_nobuffers
Date: Tue, 15 Jun 2021 17:23:38 +0100	[thread overview]
Message-ID: <20210615162342.1669332-3-willy@infradead.org> (raw)
In-Reply-To: <20210615162342.1669332-1-willy@infradead.org>

This is fundamentally the same code, so just call it instead of
duplicating it.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 mm/page-writeback.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index 0c2c8355f97f..980a6cb9cbd9 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -2503,20 +2503,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) {
-- 
2.30.2


  parent reply	other threads:[~2021-06-15 16:26 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-15 16:23 [PATCH 0/6] Further set_page_dirty cleanups Matthew Wilcox (Oracle)
2021-06-15 16:23 ` [PATCH 1/6] mm/writeback: Move __set_page_dirty() to core mm Matthew Wilcox (Oracle)
2021-06-15 16:35   ` Christoph Hellwig
2021-06-15 17:17   ` Greg Kroah-Hartman
2021-06-16 16:14   ` Matthew Wilcox
2021-06-15 16:23 ` Matthew Wilcox (Oracle) [this message]
2021-06-15 16:35   ` [PATCH 2/6] mm/writeback: Use __set_page_dirty in __set_page_dirty_nobuffers Christoph Hellwig
2021-06-15 17:18   ` Greg Kroah-Hartman
2021-06-15 16:23 ` [PATCH 3/6] iomap: Use __set_page_dirty_nobuffers Matthew Wilcox (Oracle)
2021-06-15 16:37   ` Christoph Hellwig
2021-06-15 17:19   ` Greg Kroah-Hartman
2021-06-15 17:32     ` Matthew Wilcox
2021-06-15 17:34       ` Christoph Hellwig
2021-06-15 18:04         ` Greg Kroah-Hartman
2021-06-15 18:13         ` Matthew Wilcox
2021-06-16  6:50           ` Greg Kroah-Hartman
2021-06-16 16:28             ` Matthew Wilcox
2021-06-16 16:35               ` Greg Kroah-Hartman
2021-06-15 16:23 ` [PATCH 4/6] fs: Remove anon_set_page_dirty() Matthew Wilcox (Oracle)
2021-06-15 16:37   ` Christoph Hellwig
2021-06-15 16:23 ` [PATCH 5/6] fs: Remove noop_set_page_dirty() Matthew Wilcox (Oracle)
2021-06-15 16:38   ` Christoph Hellwig
2021-06-16 18:10   ` kernel test robot
2021-06-16 18:10     ` kernel test robot
2021-06-16 18:12     ` Matthew Wilcox
2021-06-16 18:12       ` Matthew Wilcox
2021-06-16 22:33   ` kernel test robot
2021-06-16 22:33     ` kernel test robot
2021-06-15 16:23 ` [PATCH 6/6] mm: Move page dirtying prototypes from mm.h Matthew Wilcox (Oracle)
2021-06-15 16:39   ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210615162342.1669332-3-willy@infradead.org \
    --to=willy@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hch@lst.de \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.