From: Christoph Hellwig via Ocfs2-devel <ocfs2-devel@oss.oracle.com>
To: Andrew Morton <akpm@linux-foundation.org>,
Mark Fasheh <mark@fasheh.com>, Joel Becker <jlbec@evilplan.org>,
Joseph Qi <joseph.qi@linux.alibaba.com>,
Evgeniy Dushistov <dushistov@mail.ru>,
"Matthew Wilcox (Oracle)" <willy@infradead.org>
Cc: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org,
Jan Kara <jack@suse.cz>,
ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH 2/3] ocfs2: don't use write_one_page in ocfs2_duplicate_clusters_by_page
Date: Tue, 7 Mar 2023 15:31:24 +0100 [thread overview]
Message-ID: <20230307143125.27778-3-hch@lst.de> (raw)
In-Reply-To: <20230307143125.27778-1-hch@lst.de>
Use filemap_write_and_wait_range to write back the range of the dirty
page instead of write_one_page in preparation of removing write_one_page
and eventually ->writepage.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>
---
fs/ocfs2/refcounttree.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c
index 5a656dc683f108..564ab48d03effa 100644
--- a/fs/ocfs2/refcounttree.c
+++ b/fs/ocfs2/refcounttree.c
@@ -2952,10 +2952,11 @@ int ocfs2_duplicate_clusters_by_page(handle_t *handle,
*/
if (PAGE_SIZE <= OCFS2_SB(sb)->s_clustersize) {
if (PageDirty(page)) {
- /*
- * write_on_page will unlock the page on return
- */
- ret = write_one_page(page);
+ unlock_page(page);
+ put_page(page);
+
+ ret = filemap_write_and_wait_range(mapping,
+ offset, map_end - 1);
goto retry;
}
}
--
2.39.1
_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel
WARNING: multiple messages have this Message-ID (diff)
From: Christoph Hellwig <hch@lst.de>
To: Andrew Morton <akpm@linux-foundation.org>,
Mark Fasheh <mark@fasheh.com>, Joel Becker <jlbec@evilplan.org>,
Joseph Qi <joseph.qi@linux.alibaba.com>,
Evgeniy Dushistov <dushistov@mail.ru>,
"Matthew Wilcox (Oracle)" <willy@infradead.org>
Cc: ocfs2-devel@oss.oracle.com, linux-fsdevel@vger.kernel.org,
linux-mm@kvack.org, Jan Kara <jack@suse.cz>
Subject: [PATCH 2/3] ocfs2: don't use write_one_page in ocfs2_duplicate_clusters_by_page
Date: Tue, 7 Mar 2023 15:31:24 +0100 [thread overview]
Message-ID: <20230307143125.27778-3-hch@lst.de> (raw)
In-Reply-To: <20230307143125.27778-1-hch@lst.de>
Use filemap_write_and_wait_range to write back the range of the dirty
page instead of write_one_page in preparation of removing write_one_page
and eventually ->writepage.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>
---
fs/ocfs2/refcounttree.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c
index 5a656dc683f108..564ab48d03effa 100644
--- a/fs/ocfs2/refcounttree.c
+++ b/fs/ocfs2/refcounttree.c
@@ -2952,10 +2952,11 @@ int ocfs2_duplicate_clusters_by_page(handle_t *handle,
*/
if (PAGE_SIZE <= OCFS2_SB(sb)->s_clustersize) {
if (PageDirty(page)) {
- /*
- * write_on_page will unlock the page on return
- */
- ret = write_one_page(page);
+ unlock_page(page);
+ put_page(page);
+
+ ret = filemap_write_and_wait_range(mapping,
+ offset, map_end - 1);
goto retry;
}
}
--
2.39.1
next prev parent reply other threads:[~2023-03-07 14:31 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-07 14:31 [Ocfs2-devel] remove most callers of write_one_page v4 Christoph Hellwig via Ocfs2-devel
2023-03-07 14:31 ` Christoph Hellwig
2023-03-07 14:31 ` [Ocfs2-devel] [PATCH 1/3] ufs: don't flush page immediately for DIRSYNC directories Christoph Hellwig via Ocfs2-devel
2023-03-07 14:31 ` Christoph Hellwig
2023-03-10 3:53 ` [Ocfs2-devel] " Al Viro via Ocfs2-devel
2023-03-10 3:53 ` Al Viro
2023-03-10 6:37 ` [Ocfs2-devel] " Christoph Hellwig via Ocfs2-devel
2023-03-10 6:37 ` Christoph Hellwig
2023-03-10 6:52 ` [Ocfs2-devel] " Al Viro via Ocfs2-devel
2023-03-10 6:52 ` Al Viro
2023-03-10 7:00 ` [Ocfs2-devel] " Christoph Hellwig via Ocfs2-devel
2023-03-10 7:00 ` Christoph Hellwig
2023-03-10 7:09 ` [Ocfs2-devel] " Al Viro via Ocfs2-devel
2023-03-10 7:09 ` Al Viro
2023-03-07 14:31 ` Christoph Hellwig via Ocfs2-devel [this message]
2023-03-07 14:31 ` [PATCH 2/3] ocfs2: don't use write_one_page in ocfs2_duplicate_clusters_by_page Christoph Hellwig
2023-03-10 3:49 ` [Ocfs2-devel] " Al Viro via Ocfs2-devel
2023-03-10 3:49 ` Al Viro
2023-03-07 14:31 ` [Ocfs2-devel] [PATCH 3/3] mm, jfs: move write_one_page/folio_write_one to jfs Christoph Hellwig via Ocfs2-devel
2023-03-07 14:31 ` [PATCH 3/3] mm,jfs: " Christoph Hellwig
2023-03-07 16:21 ` [Ocfs2-devel] [PATCH 3/3] mm, jfs: " Dave Kleikamp via Ocfs2-devel
2023-03-07 16:21 ` [PATCH 3/3] mm,jfs: " Dave Kleikamp
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=20230307143125.27778-3-hch@lst.de \
--to=ocfs2-devel@oss.oracle.com \
--cc=akpm@linux-foundation.org \
--cc=dushistov@mail.ru \
--cc=hch@lst.de \
--cc=jack@suse.cz \
--cc=jlbec@evilplan.org \
--cc=joseph.qi@linux.alibaba.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mark@fasheh.com \
--cc=willy@infradead.org \
/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.