All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joseph Qi via Ocfs2-devel <ocfs2-devel@oss.oracle.com>
To: Christoph Hellwig <hch@lst.de>,
	Andrew Morton <akpm@linux-foundation.org>,
	Chris Mason <clm@fb.com>, Josef Bacik <josef@toxicpanda.com>,
	David Sterba <dsterba@suse.com>,
	Dave Kleikamp <shaggy@kernel.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,
	jfs-discussion@lists.sourceforge.net,
	linux-btrfs@vger.kernel.org, ocfs2-devel@oss.oracle.com
Subject: Re: [Ocfs2-devel] [PATCH 6/7] ocfs2: don't use write_one_page in ocfs2_duplicate_clusters_by_page
Date: Tue, 10 Jan 2023 11:03:31 +0800	[thread overview]
Message-ID: <8c4cbb93-cba5-82b4-74c5-0ff1dcc214a1@gmail.com> (raw)
In-Reply-To: <20230108165645.381077-7-hch@lst.de>



On 1/9/23 12:56 AM, Christoph Hellwig via Ocfs2-devel wrote:
> 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>

Looks good.
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 623db358b1efa8..4a73405962ec4f 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;
>  			}
>  		}

_______________________________________________
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: Joseph Qi <jiangqi903@gmail.com>
To: Christoph Hellwig <hch@lst.de>,
	Andrew Morton <akpm@linux-foundation.org>,
	Chris Mason <clm@fb.com>, Josef Bacik <josef@toxicpanda.com>,
	David Sterba <dsterba@suse.com>,
	Dave Kleikamp <shaggy@kernel.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,
	jfs-discussion@lists.sourceforge.net, ocfs2-devel@oss.oracle.com,
	linux-btrfs@vger.kernel.org
Subject: Re: [Ocfs2-devel] [PATCH 6/7] ocfs2: don't use write_one_page in ocfs2_duplicate_clusters_by_page
Date: Tue, 10 Jan 2023 11:03:31 +0800	[thread overview]
Message-ID: <8c4cbb93-cba5-82b4-74c5-0ff1dcc214a1@gmail.com> (raw)
In-Reply-To: <20230108165645.381077-7-hch@lst.de>



On 1/9/23 12:56 AM, Christoph Hellwig via Ocfs2-devel wrote:
> 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>

Looks good.
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 623db358b1efa8..4a73405962ec4f 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;
>  			}
>  		}

  parent reply	other threads:[~2023-01-10  3:03 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-08 16:56 remove write_one_page / folio_write_one Christoph Hellwig
2023-01-08 16:56 ` [Ocfs2-devel] " Christoph Hellwig via Ocfs2-devel
2023-01-08 16:56 ` [PATCH 1/7] btrfs: don't read the disk superblock for zoned devices in btrfs_scratch_superblocks Christoph Hellwig
2023-01-08 16:56   ` [Ocfs2-devel] " Christoph Hellwig via Ocfs2-devel
2023-01-08 16:56 ` [PATCH 2/7] btrfs: stop using write_one_page in btrfs_scratch_superblock Christoph Hellwig
2023-01-08 16:56   ` [Ocfs2-devel] " Christoph Hellwig via Ocfs2-devel
2023-01-08 21:13   ` Matthew Wilcox via Ocfs2-devel
2023-01-08 21:13     ` Matthew Wilcox
2023-01-08 16:56 ` [PATCH 3/7] minix: don't flush page immediately for DIRSYNC directories Christoph Hellwig
2023-01-08 16:56   ` [Ocfs2-devel] " Christoph Hellwig via Ocfs2-devel
2023-01-08 21:17   ` Matthew Wilcox
2023-01-08 21:17     ` [Ocfs2-devel] " Matthew Wilcox via Ocfs2-devel
2023-01-10  8:22     ` Christoph Hellwig
2023-01-10  8:22       ` [Ocfs2-devel] " Christoph Hellwig via Ocfs2-devel
2023-01-11  2:20       ` Al Viro
2023-01-11  2:20         ` [Ocfs2-devel] " Al Viro via Ocfs2-devel
2023-01-11  4:26         ` Christoph Hellwig via Ocfs2-devel
2023-01-11  4:26           ` Christoph Hellwig
2023-01-11  4:58           ` Al Viro
2023-01-11  4:58             ` [Ocfs2-devel] " Al Viro via Ocfs2-devel
2023-01-08 16:56 ` [PATCH 4/7] sysv: " Christoph Hellwig
2023-01-08 16:56   ` [Ocfs2-devel] " Christoph Hellwig via Ocfs2-devel
2023-01-08 21:19   ` Matthew Wilcox
2023-01-08 21:19     ` [Ocfs2-devel] " Matthew Wilcox via Ocfs2-devel
2023-01-10  8:24     ` Christoph Hellwig via Ocfs2-devel
2023-01-10  8:24       ` Christoph Hellwig
2023-01-08 16:56 ` [PATCH 5/7] ufs: " Christoph Hellwig
2023-01-08 16:56   ` [Ocfs2-devel] " Christoph Hellwig via Ocfs2-devel
2023-01-08 16:56 ` [PATCH 6/7] ocfs2: don't use write_one_page in ocfs2_duplicate_clusters_by_page Christoph Hellwig
2023-01-08 16:56   ` [Ocfs2-devel] " Christoph Hellwig via Ocfs2-devel
2023-01-09 17:03   ` Jan Kara via Ocfs2-devel
2023-01-09 17:03     ` Jan Kara
2023-01-10  3:03   ` Joseph Qi via Ocfs2-devel [this message]
2023-01-10  3:03     ` [Ocfs2-devel] " Joseph Qi
2023-01-08 16:56 ` [PATCH 7/7] mm,jfs: move write_one_page/folio_write_one to jfs Christoph Hellwig
2023-01-08 16:56   ` [Ocfs2-devel] [PATCH 7/7] mm, jfs: " Christoph Hellwig via Ocfs2-devel
2023-01-08 21:31 ` remove write_one_page / folio_write_one Matthew Wilcox
2023-01-08 21:31   ` [Ocfs2-devel] " Matthew Wilcox via Ocfs2-devel
2023-01-09 19:53 ` David Sterba
2023-01-09 19:53   ` [Ocfs2-devel] " David Sterba via Ocfs2-devel
2023-01-10  8:16   ` Christoph Hellwig
2023-01-10  8:16     ` [Ocfs2-devel] " Christoph Hellwig via Ocfs2-devel
2023-01-10 13:00     ` David Sterba
2023-01-10 13:00       ` [Ocfs2-devel] " David Sterba via Ocfs2-devel
2023-01-10 15:32       ` Christoph Hellwig via Ocfs2-devel
2023-01-10 15:32         ` Christoph Hellwig
2023-01-11 19:20         ` David Sterba
2023-01-11 19:20           ` [Ocfs2-devel] " David Sterba via Ocfs2-devel
2023-01-12  8:02           ` Christoph Hellwig
2023-01-12  8:02             ` [Ocfs2-devel] " Christoph Hellwig via Ocfs2-devel

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=8c4cbb93-cba5-82b4-74c5-0ff1dcc214a1@gmail.com \
    --to=ocfs2-devel@oss.oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=clm@fb.com \
    --cc=dsterba@suse.com \
    --cc=dushistov@mail.ru \
    --cc=hch@lst.de \
    --cc=jfs-discussion@lists.sourceforge.net \
    --cc=jiangqi903@gmail.com \
    --cc=jlbec@evilplan.org \
    --cc=josef@toxicpanda.com \
    --cc=joseph.qi@linux.alibaba.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mark@fasheh.com \
    --cc=shaggy@kernel.org \
    --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.