linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/5] btrfs: btrfs_get_extent() cleanup for inline extents
@ 2022-09-16  7:28 Qu Wenruo
  2022-09-16  7:28 ` [PATCH v2 1/5] btrfs: selftests: remove impossible inline extent at non-zero file offset Qu Wenruo
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: Qu Wenruo @ 2022-09-16  7:28 UTC (permalink / raw)
  To: linux-btrfs

Currently we have some very confusing (and harder to explain) code
inside btrfs_get_extent() for inline extents.

The TL;DR is, those mess is to support inline extents at non-zero file
offset.

This is completely impossible now, as tree-checker will reject any
inline file extents at non-zero offset.

So this series will:

- Update the selftest to get rid of the impossible case

- Simplify the inline extent read

  Since we no longer need to support inline extents at non-zero file
  offset, some variables can be removed.

- Don't reset the inline extent map members

  Those resets are either doing nothing (setting the member to the same
  value), or making no difference (the member is not utilized anyway)

- Remove @new_inline argument for btrfs_extent_item_to_extent_map()

  That argument makes btrfs_get_extent() to skip certain member update.
  Previously it makes a difference only for fiemap.

  But now since fiemap no longer relies on extent_map, the remaining
  use cases won't bother those members anyway.

  Thus we can remove the bool argument and make
  btrfs_extent_item_to_extent_map() to have a consistent behavior.

- Introduce a helper to do inline extents read

  Now the function is so simple that, extracting the helper can only
  reduce indents.

[CHANGELOG]
v2:
- Do better patch split for bisection with better reason

- Put the selftest to the first to help bisection
  Or we may hit ASSERT() during selftest.

Qu Wenruo (5):
  btrfs: selftests: remove impossible inline extent at non-zero file
    offset
  btrfs: make inline extent read calculation much simpler
  btrfs: do not reset extent map members for inline extents read
  btrfs: remove the @new_inline argument from
    btrfs_extent_item_to_extent_map()
  btrfs: extract the inline extent read code into its own function

 fs/btrfs/ctree.h             |   1 -
 fs/btrfs/extent_map.c        |   7 +++
 fs/btrfs/file-item.c         |   6 +--
 fs/btrfs/inode.c             | 100 +++++++++++++++++++----------------
 fs/btrfs/ioctl.c             |   2 +-
 fs/btrfs/tests/inode-tests.c |  56 +++++++-------------
 6 files changed, 83 insertions(+), 89 deletions(-)

-- 
2.37.3


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-10-27 14:46 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-16  7:28 [PATCH v2 0/5] btrfs: btrfs_get_extent() cleanup for inline extents Qu Wenruo
2022-09-16  7:28 ` [PATCH v2 1/5] btrfs: selftests: remove impossible inline extent at non-zero file offset Qu Wenruo
2022-09-16  7:28 ` [PATCH v2 2/5] btrfs: make inline extent read calculation much simpler Qu Wenruo
2022-09-16  7:28 ` [PATCH v2 3/5] btrfs: do not reset extent map members for inline extents read Qu Wenruo
2022-09-16  7:28 ` [PATCH v2 4/5] btrfs: remove the @new_inline argument from btrfs_extent_item_to_extent_map() Qu Wenruo
2022-09-16  7:28 ` [PATCH v2 5/5] btrfs: extract the inline extent read code into its own function Qu Wenruo
2022-10-25 14:11   ` David Sterba
2022-10-25 14:08 ` [PATCH v2 0/5] btrfs: btrfs_get_extent() cleanup for inline extents David Sterba
2022-10-27 14:46   ` David Sterba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).