Skip to content

Commit 5a17fa0

Browse files
fdmananakdave
authored andcommitted
btrfs: always use left leaf variable in __push_leaf_right()
The 'left' variable points to path->nodes[0] and path->nodes[0] is never changed, but some places use 'left' while others refer to path->nodes[0]. Update all sites to use 'left' as not only it's shorter it's also easier to reason since it means the left leaf and avoids any confusion with the sibling right 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 05bfadc commit 5a17fa0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

fs/btrfs/ctree.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3240,10 +3240,10 @@ static noinline int __push_leaf_right(struct btrfs_trans_handle *trans,
32403240
/* then fixup the leaf pointer in the path */
32413241
if (path->slots[0] >= left_nritems) {
32423242
path->slots[0] -= left_nritems;
3243-
if (btrfs_header_nritems(path->nodes[0]) == 0)
3244-
btrfs_clear_buffer_dirty(trans, path->nodes[0]);
3245-
btrfs_tree_unlock(path->nodes[0]);
3246-
free_extent_buffer(path->nodes[0]);
3243+
if (btrfs_header_nritems(left) == 0)
3244+
btrfs_clear_buffer_dirty(trans, left);
3245+
btrfs_tree_unlock(left);
3246+
free_extent_buffer(left);
32473247
path->nodes[0] = right;
32483248
path->slots[1] += 1;
32493249
} else {

0 commit comments

Comments
 (0)