All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chao Yu via Linux-f2fs-devel <linux-f2fs-devel@lists.sourceforge.net>
To: Matthew Wilcox <willy@infradead.org>, Eric Biggers <ebiggers@kernel.org>
Cc: jaegeuk@kernel.org, linux-kernel@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH 5/6] f2fs: use fscrypt_finalize_bounce_page() for cleanup
Date: Tue, 16 Jun 2026 07:40:53 +0000	[thread overview]
Message-ID: <076be691-398b-4365-a06b-9e290fa52a8e@kernel.org> (raw)
In-Reply-To: <ai_57zkSdVklsPuw@casper.infradead.org>

On 6/15/26 13:11, Matthew Wilcox wrote:
> On Mon, Jun 15, 2026 at 09:08:21PM +0800, Chao Yu wrote:
>> No logic changes.
> 
> This seems like a step backwards.  We should be looking to convert to
> a future fscrypt_finalize_bounce_folio(), if anything.

You're right, what do you think of this?

 From 533ee72170c2ad451097db926dd713d9fea442f9 Mon Sep 17 00:00:00 2001
From: Chao Yu <chao@kernel.org>
Date: Fri, 26 Sep 2025 01:43:06 +0800
Subject: [PATCH] fscrypt,f2fs: introduce fscrypt_finalize_bounce_folio() for
  cleanup

As part of the linux kernel's migration to folio-based APIs, introduce
fscrypt_finalize_bounce_folio() as the folio equivalent of
fscrypt_finalize_bounce_page(), and clean up f2fs codes with this new
helper.

Suggested-by: Matthew Wilcox <willy@infradead.org>
Cc: Eric Biggers <ebiggers@kernel.org>
Signed-off-by: Chao Yu <chao@kernel.org>
---
  fs/f2fs/data.c          |  7 +------
  include/linux/fscrypt.h | 11 +++++++++++
  2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index ac1cf4de3d62..e0fca6c60e34 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -362,12 +362,7 @@ static void f2fs_write_end_bio(struct bio *bio)
  		struct folio *folio = fi.folio;
  		enum count_type type;

-		if (fscrypt_is_bounce_folio(folio)) {
-			struct folio *io_folio = folio;
-
-			folio = fscrypt_pagecache_folio(io_folio);
-			fscrypt_free_bounce_page(&io_folio->page);
-		}
+		fscrypt_finalize_bounce_folio(&folio);

  #ifdef CONFIG_F2FS_FS_COMPRESSION
  		if (f2fs_is_compressed_page(folio)) {
diff --git a/include/linux/fscrypt.h b/include/linux/fscrypt.h
index 54712ec61ffb..20b59b021c94 100644
--- a/include/linux/fscrypt.h
+++ b/include/linux/fscrypt.h
@@ -1132,4 +1132,15 @@ static inline void fscrypt_finalize_bounce_page(struct page **pagep)
  	}
  }

+/* If *foliop is a bounce folio, free it and set *foliop to the pagecache folio */
+static inline void fscrypt_finalize_bounce_folio(struct folio **foliop)
+{
+	struct folio *folio = *foliop;
+
+	if (fscrypt_is_bounce_folio(folio)) {
+		*foliop = fscrypt_pagecache_folio(folio);
+		fscrypt_free_bounce_page(&folio->page);
+	}
+}
+
  #endif	/* _LINUX_FSCRYPT_H */
-- 
2.49.0



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

WARNING: multiple messages have this Message-ID (diff)
From: Chao Yu <chao@kernel.org>
To: Matthew Wilcox <willy@infradead.org>, Eric Biggers <ebiggers@kernel.org>
Cc: chao@kernel.org, jaegeuk@kernel.org,
	linux-f2fs-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 5/6] f2fs: use fscrypt_finalize_bounce_page() for cleanup
Date: Tue, 16 Jun 2026 07:40:53 +0000	[thread overview]
Message-ID: <076be691-398b-4365-a06b-9e290fa52a8e@kernel.org> (raw)
In-Reply-To: <ai_57zkSdVklsPuw@casper.infradead.org>

On 6/15/26 13:11, Matthew Wilcox wrote:
> On Mon, Jun 15, 2026 at 09:08:21PM +0800, Chao Yu wrote:
>> No logic changes.
> 
> This seems like a step backwards.  We should be looking to convert to
> a future fscrypt_finalize_bounce_folio(), if anything.

You're right, what do you think of this?

 From 533ee72170c2ad451097db926dd713d9fea442f9 Mon Sep 17 00:00:00 2001
From: Chao Yu <chao@kernel.org>
Date: Fri, 26 Sep 2025 01:43:06 +0800
Subject: [PATCH] fscrypt,f2fs: introduce fscrypt_finalize_bounce_folio() for
  cleanup

As part of the linux kernel's migration to folio-based APIs, introduce
fscrypt_finalize_bounce_folio() as the folio equivalent of
fscrypt_finalize_bounce_page(), and clean up f2fs codes with this new
helper.

Suggested-by: Matthew Wilcox <willy@infradead.org>
Cc: Eric Biggers <ebiggers@kernel.org>
Signed-off-by: Chao Yu <chao@kernel.org>
---
  fs/f2fs/data.c          |  7 +------
  include/linux/fscrypt.h | 11 +++++++++++
  2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index ac1cf4de3d62..e0fca6c60e34 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -362,12 +362,7 @@ static void f2fs_write_end_bio(struct bio *bio)
  		struct folio *folio = fi.folio;
  		enum count_type type;

-		if (fscrypt_is_bounce_folio(folio)) {
-			struct folio *io_folio = folio;
-
-			folio = fscrypt_pagecache_folio(io_folio);
-			fscrypt_free_bounce_page(&io_folio->page);
-		}
+		fscrypt_finalize_bounce_folio(&folio);

  #ifdef CONFIG_F2FS_FS_COMPRESSION
  		if (f2fs_is_compressed_page(folio)) {
diff --git a/include/linux/fscrypt.h b/include/linux/fscrypt.h
index 54712ec61ffb..20b59b021c94 100644
--- a/include/linux/fscrypt.h
+++ b/include/linux/fscrypt.h
@@ -1132,4 +1132,15 @@ static inline void fscrypt_finalize_bounce_page(struct page **pagep)
  	}
  }

+/* If *foliop is a bounce folio, free it and set *foliop to the pagecache folio */
+static inline void fscrypt_finalize_bounce_folio(struct folio **foliop)
+{
+	struct folio *folio = *foliop;
+
+	if (fscrypt_is_bounce_folio(folio)) {
+		*foliop = fscrypt_pagecache_folio(folio);
+		fscrypt_free_bounce_page(&folio->page);
+	}
+}
+
  #endif	/* _LINUX_FSCRYPT_H */
-- 
2.49.0


  reply	other threads:[~2026-06-16  7:41 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-15 13:08 [PATCH 1/6] f2fs: fix wrong description in printed log Chao Yu
2026-06-15 13:08 ` [f2fs-dev] " Chao Yu via Linux-f2fs-devel
2026-06-15 13:08 ` [PATCH 2/6] f2fs: misc cleanup in f2fs_record_stop_reason() Chao Yu
2026-06-15 13:08   ` [f2fs-dev] " Chao Yu via Linux-f2fs-devel
2026-06-15 13:08 ` [PATCH 3/6] f2fs: avoid unnecessary sanity check on ckpt_valid_blocks Chao Yu
2026-06-15 13:08   ` [f2fs-dev] " Chao Yu via Linux-f2fs-devel
2026-06-15 13:08 ` [PATCH 4/6] f2fs: avoid unnecessary fscrypt_finalize_bounce_page() Chao Yu
2026-06-15 13:08   ` [f2fs-dev] " Chao Yu via Linux-f2fs-devel
2026-06-15 22:14   ` Jaegeuk Kim via Linux-f2fs-devel
2026-06-15 22:14     ` Jaegeuk Kim
2026-06-16  3:12     ` Chao Yu
2026-06-16  3:12       ` Chao Yu via Linux-f2fs-devel
2026-06-15 13:08 ` [PATCH 5/6] f2fs: use fscrypt_finalize_bounce_page() for cleanup Chao Yu
2026-06-15 13:08   ` [f2fs-dev] " Chao Yu via Linux-f2fs-devel
2026-06-15 13:11   ` Matthew Wilcox
2026-06-15 13:11     ` Matthew Wilcox
2026-06-16  7:40     ` Chao Yu via Linux-f2fs-devel [this message]
2026-06-16  7:40       ` Chao Yu
2026-06-15 13:08 ` [PATCH 6/6] f2fs: remove unneeded f2fs_is_compressed_page() Chao Yu
2026-06-15 13:08   ` [f2fs-dev] " Chao Yu via Linux-f2fs-devel
2026-06-16  2:50 ` [f2fs-dev] [PATCH 1/6] f2fs: fix wrong description in printed log patchwork-bot+f2fs--- via Linux-f2fs-devel
2026-06-16  2:50   ` patchwork-bot+f2fs

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=076be691-398b-4365-a06b-9e290fa52a8e@kernel.org \
    --to=linux-f2fs-devel@lists.sourceforge.net \
    --cc=chao@kernel.org \
    --cc=ebiggers@kernel.org \
    --cc=jaegeuk@kernel.org \
    --cc=linux-kernel@vger.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.