@@ -4376,7 +4376,8 @@ void btrfs_truncate_item(struct btrfs_trans_handle *trans,
}
/*
- * make the item pointed to by the path bigger, data_size is the new size.
+ * make the item pointed to by the path bigger.
+ * data_size is the to be extended size.
*/
void btrfs_extend_item(struct btrfs_trans_handle *trans,
struct btrfs_root *root, struct btrfs_path *path,
@@ -4432,7 +4433,6 @@ void btrfs_extend_item(struct btrfs_trans_handle *trans,
data_end - data_size, btrfs_leaf_data(leaf) +
data_end, old_data - data_end);
- data_end = old_data;
old_size = btrfs_item_size_nr(leaf, slot);
item = btrfs_item_nr(leaf, slot);
btrfs_set_item_size(leaf, item, old_size + data_size);
Two cleanups: * The data_size is the new added size, not the new size after extend. Make the description more clear. * The var data_end is not used anymore after the data shift. Remove the useless assignment. Signed-off-by: Wang Sheng-Hui <shhuiw@gmail.com> --- fs/btrfs/ctree.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)