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

Qu Wenruo <[email protected]>
Newsgroups org.kernel.vger.linux-btrfs
Message-ID <[email protected]>
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(-)

-- 
2.54.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.