回复: [PATCH 1/3] btrfs: get rid of path allocation in btrfs_del_inode_extref()

From: 李扬韬
Date: Thu Apr 17 2025 - 10:15:39 EST


> Honestly I don't like adding yet another function to do such "reset" thing.
>
> Leaving path->skip_release_on_error is perfectly fine in this scenario.
> If that bothers anyone so much, just set path->skip_release_on_error to 0 after calling btrfs_release_path() and before passing the path to btrfs_insert_inode_extref().
>
> This is the sort of optimization that is not worth spending this much time and adding new APIs - freeing and allocating a path shortly after is almost always fast as we're using a slab, plus this is a rarely hit use case - having to use extrefs, meaning we have a very large number of inode refs.

I am fine to add btrfs_reset_path or just clear path->skip_release_on_error.

David, what do you think?

Thx,
Yangtao