diff options
| author | Jeff Layton <jlayton@kernel.org> | 2026-08-25 12:04:18 -0400 |
|---|---|---|
| committer | David Sterba <dsterba@suse.com> | 2026-10-12 19:16:20 +0200 |
| commit | f95420e3068fe62ce659e150f81ddf894b56c8c9 (patch) | |
| tree | f94647c664eacc8600c51d1f0ccfe27b336ea19a /tools/perf/scripts/python/stackcollapse.py | |
| parent | 24d966dea969f9ee327de2e85d50eff1e459fbce (diff) | |
| download | linux-f95420e3068fe62ce659e150f81ddf894b56c8c9.tar.gz linux-f95420e3068fe62ce659e150f81ddf894b56c8c9.zip | |
btrfs: pre-allocate delayed dir index before btree modification
Move the delayed dir index allocation in btrfs_insert_dir_item() before
the insert_with_overflow() call that modifies the btree. Previously, the
allocations happened after the DIR_ITEM was already inserted, meaning an
ENOMEM failure left the btree in a partially-modified state that could
only be resolved by aborting the transaction.
Add an optional caller-provided btrfs_dir_index_prealloc parameter to
btrfs_insert_dir_item(). When non-NULL, ownership of the prealloc
transfers to btrfs_insert_dir_item(). When NULL, it allocates internally.
All existing callers pass NULL to preserve the current behavior.
Since ownership transfers, btrfs_insert_dir_item() must free the prealloc
on every path that does not commit it. Route all such exits (including
the early path allocation failure) through a common out_free_prealloc
label, rather than keying cleanup on need_delayed_index.
Remove the btrfs_insert_delayed_dir_index() wrapper, as there are no
more callers.
Assisted-by: LLM
Suggested-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions
