linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wang Sheng-Hui <shhuiw@gmail.com>
To: Josef Bacik <jbacik@fusionio.com>,
	chris.mason@fusionio.com, linux-btrfs@vger.kernel.org
Subject: [PATCH] Btrfs: cleanup for btrfs_extend_item
Date: Wed, 23 Jan 2013 15:25:17 +0800	[thread overview]
Message-ID: <50FF905D.80805@gmail.com> (raw)

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 --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);
-- 
1.7.10.4


                 reply	other threads:[~2013-01-23  7:25 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50FF905D.80805@gmail.com \
    --to=shhuiw@gmail.com \
    --cc=chris.mason@fusionio.com \
    --cc=jbacik@fusionio.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).