* [PATCH] Btrfs: cleanup for btrfs_extend_item
@ 2013-01-23 7:25 Wang Sheng-Hui
0 siblings, 0 replies; only message in thread
From: Wang Sheng-Hui @ 2013-01-23 7:25 UTC (permalink / raw)
To: Josef Bacik, chris.mason, linux-btrfs
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2013-01-23 7:25 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-23 7:25 [PATCH] Btrfs: cleanup for btrfs_extend_item Wang Sheng-Hui
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).