Re: [PATCH v3 06/14] f2fs: stop using PG_private

From: Tal Zussman

Date: Sun Sep 13 2026 - 16:14:01 EST


On 9/10/26 5:11 PM, Zi Yan wrote:
> OK, here is the patch. In addition to David's patch and Tal' suggestion,
> I also
> 1. converted PAGE_PRIVATE_* flags to F2FS_FOLIO_PRIVATE_*,
> 2. converted page/folio union in f2fs_io_info to folio only, since no
> one is using fio->page any more.
>

Nice!

> Let me know your feedback. I will add this to my patch series once you
> are OK with it. Thanks.
>
> From 3bae5c494459b3dd05893df6051e3eb37164f810 Mon Sep 17 00:00:00 2001
> From: Zi Yan <ziy@xxxxxxxxxx>
> Date: Thu, 10 Sep 2026 16:42:39 -0400
> Subject: [PATCH] f2fs: convert the ->private flag helpers to folio-only
>
> page-based ->private flag helpers are used in the compression path, where
> large folios are not enabled. They can use folio versions with
> page_folio(). The two remaining users in data.c and segment.c can use
> fio->folio instead of fio->page (two are in a union).
>
> Drop page-based helpers after the conversion and rename
> PAGE_PRIVATE_{GET,SET,CLEAR}_FUNC() and the PAGE_PRIVATE_* flags to
> F2FS_FOLIO_PRIVATE_* to match. Convert the folio/page union from
> f2fs_io_info union to folio only, since no page user is left.
>
> The folio helpers do a plain read-modify-write where the page ones used
> set_bit()/clear_bit(). It is fine because the converted code either holds
> folio lock or, in f2fs_compress_write_end_io(), matches what the
> non-compressed code does in f2fs_write_end_bio().
>
> Assisted-by: Claude:claude-opus-5
> Suggested-by: Tal Zussman <tz2294@xxxxxxxxxxxx>
> Co-developed-by: David Hildenbrand (Arm) <david@xxxxxxxxxx>
> Signed-off-by: David Hildenbrand (Arm) <david@xxxxxxxxxx>
> Signed-off-by: Zi Yan <ziy@xxxxxxxxxx>
> To: Jaegeuk Kim <jaegeuk@xxxxxxxxxx>
> To: Chao Yu <chao@xxxxxxxxxx>
> Cc: linux-f2fs-devel@xxxxxxxxxxxxxxxxxxxxx
> Cc: linux-kernel@xxxxxxxxxxxxxxx

Looks good, so:

Reviewed-by: Tal Zussman <tz2294@xxxxxxxxxxxx>