diff mbox

Btrfs: cleanup for btrfs_extend_item

Message ID 50FF905D.80805@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Wang Sheng-Hui Jan. 23, 2013, 7:25 a.m. UTC
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(-)
diff mbox

Patch

diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
index eea5da7..c4f295e 100644
--- a/fs/btrfs/ctree.c
+++ b/fs/btrfs/ctree.c
@@ -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);