Skip to content

btrfs: minor cleanup for subpage helpers

Qu Wenruo linux-btrfs 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2btrfs: remove NULL fs_info checks in subpage helpersfs/btrfs/subpage.c+8 -190 replies
2/2btrfs: unify data and metadata subpage handlingfs/btrfs/subpage.c fs/btrfs/subpage.h+33 -350 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] btrfs: minor cleanup for subpage helpers

The first patch removes dead "unlikely(!fs_info)" checks, as commit b2136cc288fc ("btrfs: tests: allocate dummy fs_info and root in test_find_delalloc()") has properly allocated a dummy fs_info for extent-io-tests.

The second patch is inspired by Boris' new cow fixup, where we can determine if a folio belongs to data or metadata.
As the only special case is when the folio has no mapping. Meanwhile for data folios they are always from page cache, thus they are always mapped.
So an unmapped folio must belongs to metadata, for dummy ebs.

This allows us to enhance btrfs_is_subpage() to cover both data and metadata, now btrfs_meta_folio_*() helpers are just a simple wrapper for the correponding btrfs_folio_*() helpers.

Qu Wenruo (2):
btrfs: remove NULL fs_info checks in subpage helpers
btrfs: unify data and metadata subpage handling

 fs/btrfs/subpage.c | 50 +++++++++-------------------------------------
 fs/btrfs/subpage.h | 45 +++++++++++++++++++++++++++++------------
 2 files changed, 41 insertions(+), 54 deletions(-)
Signature · 1 line
2.54.0