btrfs: btrfs_get_extent() cleanup for inline extents
Get series with b4
b4 am [email protected]Versions newest first
- v2 Latest5 patches 3 repliesIn review
Changes in v2 from the cover letter
- 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.
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/5 | btrfs: selftests: remove impossible inline extent at non-zero file offsetfs/ fs/ | +25 | 0 replies | |
| 2/5 | btrfs: make inline extent read calculation much simplerfs/ | +20 | 0 replies | |
| 3/5 | btrfs: do not reset extent map members for inline extents readfs/ | +9 | 0 replies | |
| 4/5 | btrfs: remove the @new_inline argument from btrfs_extent_item_to_extent_map()fs/ fs/ fs/ +1 more | +4 | 0 replies | |
| 5/5 | btrfs: extract the inline extent read code into its own functionfs/ | +38 | 1 reply |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [PATCH v2 0/5] btrfs: btrfs_get_extent() cleanup for inline extents
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(-)
Signature · 1 line
2.37.3