aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs
diff options
context:
space:
mode:
authorYan <yanzheng@21cn.com>2007-11-26 10:58:13 -0500
committerChris Mason <chris.mason@oracle.com>2008-09-25 11:03:58 -0400
commiteef1c494a2d4212e13c67d05e9cc3cd1e6dfed5d (patch)
tree71008c91fbe6cd34eb77827e1e7325082c023e91 /fs/btrfs
parent0e4de58432f552c0ecead965b0fad8a9fb1d31ec (diff)
Btrfs: Properly update right_nritems in push_leaf_left
The codes that fixup the right leaf and the codes that dirty the extnet buffer use the variable 'right_nritems' , both of them expect 'right_nritems' is the number of items in right leaf after the push. Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r--fs/btrfs/ctree.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
index 1b47fe71e0b4..3b16051b121b 100644
--- a/fs/btrfs/ctree.c
+++ b/fs/btrfs/ctree.c
@@ -1717,11 +1717,10 @@ static int push_leaf_left(struct btrfs_trans_handle *trans, struct btrfs_root
1717 btrfs_item_nr_offset(push_items), 1717 btrfs_item_nr_offset(push_items),
1718 (btrfs_header_nritems(right) - push_items) * 1718 (btrfs_header_nritems(right) - push_items) *
1719 sizeof(struct btrfs_item)); 1719 sizeof(struct btrfs_item));
1720
1721 } 1720 }
1722 btrfs_set_header_nritems(right, right_nritems - push_items); 1721 right_nritems -= push_items;
1722 btrfs_set_header_nritems(right, right_nritems);
1723 push_space = BTRFS_LEAF_DATA_SIZE(root); 1723 push_space = BTRFS_LEAF_DATA_SIZE(root);
1724
1725 for (i = 0; i < right_nritems; i++) { 1724 for (i = 0; i < right_nritems; i++) {
1726 item = btrfs_item_nr(right, i); 1725 item = btrfs_item_nr(right, i);
1727 1726