Re: [PATCH] btrfs: perform a minor cleanup in btrfs_search_path_in_tree()

From: David Sterba

Date: Tue Feb 24 2026 - 12:28:48 EST


On Thu, Feb 19, 2026 at 05:55:32PM +0000, Burenchev Evgenii wrote:
> After the introduction of btrfs_search_backwards(), the directory
> traversal state in btrfs_search_path_in_tree() is fully maintained via
> struct btrfs_key. The local variable 'dirid' is no longer used to control
> the search and the assignment
>
> dirid = key.objectid;
>
> has no observable effect and is dead code.
>

Can you please split the patch to 1) remove the dirid assignment (v1 of
this patch) and 2) the return cleanup? It's two changes, the dead code
is trivial, but the return code should match some pattern we're using.

Sometimes the explicit 'ret = 0' is there to make it clear there's no
stale error code being propagated out of the function, but in this case
I don't se a reason for it.

Thanks.