From: Qu Wenruo <wqu@suse.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH v2 0/5] btrfs: btrfs_get_extent() cleanup for inline extents
Date: Fri, 16 Sep 2022 15:28:34 +0800 [thread overview]
Message-ID: <cover.1663312786.git.wqu@suse.com> (raw)
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
next reply other threads:[~2022-09-16 7:29 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-16 7:28 Qu Wenruo [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1663312786.git.wqu@suse.com \
--to=wqu@suse.com \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox