Skip to content

Commit 74406ba

Browse files
fdmananakdave
authored andcommitted
btrfs: always use right leaf variable in __push_leaf_left()
The 'right' variable points to path->nodes[0] and path->nodes[0] is never changed, but some places use 'right' while others refer to path->nodes[0]. Update all sites to use 'right' as not only it's shorter it's also easier to reason since it means the right leaf and avoids any confusion with the sibling left leaf. Signed-off-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent 8ea4690 commit 74406ba

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/btrfs/ctree.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3454,8 +3454,8 @@ static noinline int __push_leaf_left(struct btrfs_trans_handle *trans,
34543454
/* then fixup the leaf pointer in the path */
34553455
if (path->slots[0] < push_items) {
34563456
path->slots[0] += old_left_nritems;
3457-
btrfs_tree_unlock(path->nodes[0]);
3458-
free_extent_buffer(path->nodes[0]);
3457+
btrfs_tree_unlock(right);
3458+
free_extent_buffer(right);
34593459
path->nodes[0] = left;
34603460
path->slots[1] -= 1;
34613461
} else {

0 commit comments

Comments
 (0)