Skip to content

Commit fc0716c

Browse files
lorddoskiaskdave
authored andcommitted
btrfs: re-arrange statements in setup_items_for_insert
Rearrange statements calculating the offset of the newly added items so that the calculation has to be done only once. No functional change. Reviewed-by: Josef Bacik <josef@toxicpanda.com> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: Nikolay Borisov <nborisov@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent 7573df5 commit fc0716c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎fs/btrfs/ctree.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4832,8 +4832,8 @@ void setup_items_for_insert(struct btrfs_root *root, struct btrfs_path *path,
48324832
btrfs_cpu_key_to_disk(&disk_key, cpu_key + i);
48334833
btrfs_set_item_key(leaf, &disk_key, slot + i);
48344834
item = btrfs_item_nr(slot + i);
4835-
btrfs_set_token_item_offset(&token, item, data_end - data_size[i]);
48364835
data_end -= data_size[i];
4836+
btrfs_set_token_item_offset(&token, item, data_end);
48374837
btrfs_set_token_item_size(&token, item, data_size[i]);
48384838
}
48394839

0 commit comments

Comments
 (0)