summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ctree.c
diff options
context:
space:
mode:
authorAneesh <aneesh.kumar@gmail.com>2007-07-11 16:03:27 +0200
committerDavid Woodhouse <dwmw2@hera.kernel.org>2007-07-11 16:03:27 +0200
commita1f396304fb7e5f18e4ea81c294415375f1c814c (patch)
treead36d38ff59d3421090c75846a2251d0bde3f248 /fs/btrfs/ctree.c
parentBtrfs: trivial include fixups (diff)
downloadlinux-a1f396304fb7e5f18e4ea81c294415375f1c814c.tar.xz
linux-a1f396304fb7e5f18e4ea81c294415375f1c814c.zip
Btrfs: Some code cleanups
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/ctree.c')
-rw-r--r--fs/btrfs/ctree.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
index eace2ee76448..19a30b7c3a28 100644
--- a/fs/btrfs/ctree.c
+++ b/fs/btrfs/ctree.c
@@ -172,11 +172,13 @@ static int check_node(struct btrfs_root *root, struct btrfs_path *path,
if (path->nodes[level + 1])
parent = btrfs_buffer_node(path->nodes[level + 1]);
- parent_slot = path->slots[level + 1];
+
slot = path->slots[level];
BUG_ON(nritems == 0);
if (parent) {
struct btrfs_disk_key *parent_key;
+
+ parent_slot = path->slots[level + 1];
parent_key = &parent->ptrs[parent_slot].key;
BUG_ON(memcmp(parent_key, &node->ptrs[0].key,
sizeof(struct btrfs_disk_key)));
@@ -208,7 +210,7 @@ static int check_leaf(struct btrfs_root *root, struct btrfs_path *path,
if (path->nodes[level + 1])
parent = btrfs_buffer_node(path->nodes[level + 1]);
- parent_slot = path->slots[level + 1];
+
BUG_ON(btrfs_leaf_free_space(root, leaf) < 0);
if (nritems == 0)
@@ -216,6 +218,8 @@ static int check_leaf(struct btrfs_root *root, struct btrfs_path *path,
if (parent) {
struct btrfs_disk_key *parent_key;
+
+ parent_slot = path->slots[level + 1];
parent_key = &parent->ptrs[parent_slot].key;
BUG_ON(memcmp(parent_key, &leaf->items[0].key,
sizeof(struct btrfs_disk_key)));