Skip to contentSkip to conversation

btrfs: remove dead assignment to dirid in btrfs_search_path_in_tree()

PATCH New Burenchev Evgenii 1 participant 1 message Feb 25 Btrfs file system

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 btrfs: remove dead assignment to dirid in btrfs_search_path_in_tree()

Related discussion: https://lore.kernel.org/linux-btrfs/[email protected]

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 assignment:

    dirid = key.objectid;

no longer affects control flow and is dead code.

Remove the unused assignment to avoid confusion and silence static analysis warnings.

No functional change.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Changes since v1:
- split from original patch

---
 fs/btrfs/ioctl.c | 1 -
 1 file changed, 1 deletion(-)
fs/btrfs/ioctl.c +0 -1
index ae2173235c4d..3a45ee1a7026 100644
@@ -1707,7 +1707,6 @@ static noinline int btrfs_search_path_in_tree(struct btrfs_fs_info *info,
 		btrfs_release_path(path);
 		key.objectid = key.offset;
 		key.offset = (u64)-1;
-		dirid = key.objectid;
 	}
 	memmove(name, ptr, total_len);
 	name[total_len] = '\0';
Signature · 1 line
2.43.0