summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ctree.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2007-02-28 22:46:22 +0100
committerDavid Woodhouse <dwmw2@hera.kernel.org>2007-02-28 22:46:22 +0100
commit0f70abe2b39d19171d4133d2ffdf77fb9113106a (patch)
tree98e6b00b38579385e64c085be43c65ab66780772 /fs/btrfs/ctree.c
parentBtrfs: return code checking (diff)
downloadlinux-0f70abe2b39d19171d4133d2ffdf77fb9113106a.tar.xz
linux-0f70abe2b39d19171d4133d2ffdf77fb9113106a.zip
Btrfs: more return code checking
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/ctree.c')
-rw-r--r--fs/btrfs/ctree.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
index be2be0272513..273239932255 100644
--- a/fs/btrfs/ctree.c
+++ b/fs/btrfs/ctree.c
@@ -1087,7 +1087,9 @@ static int del_ptr(struct ctree_root *root, struct ctree_path *path, int level)
break;
}
level++;
- free_extent(root, blocknr, 1);
+ wret = free_extent(root, blocknr, 1);
+ if (wret)
+ ret = wret;
if (!path->nodes[level])
BUG();
}
@@ -1136,7 +1138,9 @@ int del_item(struct ctree_root *root, struct ctree_path *path)
wret = del_ptr(root, path, 1);
if (wret)
ret = wret;
- free_extent(root, leaf_buf->blocknr, 1);
+ wret = free_extent(root, leaf_buf->blocknr, 1);
+ if (wret)
+ ret = wret;
}
} else {
int used = leaf_space_used(leaf, 0, leaf->header.nritems);
@@ -1173,7 +1177,9 @@ int del_item(struct ctree_root *root, struct ctree_path *path)
if (wret)
ret = wret;
tree_block_release(root, leaf_buf);
- free_extent(root, blocknr, 1);
+ wret = free_extent(root, blocknr, 1);
+ if (wret)
+ ret = wret;
} else {
tree_block_release(root, leaf_buf);
}
@@ -1184,7 +1190,8 @@ int del_item(struct ctree_root *root, struct ctree_path *path)
/*
* walk up the tree as far as required to find the next leaf.
- * returns 0 if it found something or -1 if there are no greater leaves.
+ * returns 0 if it found something or 1 if there are no greater leaves.
+ * returns < 0 on io errors.
*/
int next_leaf(struct ctree_root *root, struct ctree_path *path)
{
@@ -1196,7 +1203,7 @@ int next_leaf(struct ctree_root *root, struct ctree_path *path)
while(level < MAX_LEVEL) {
if (!path->nodes[level])
- return -1;
+ return 1;
slot = path->slots[level] + 1;
c = path->nodes[level];
if (slot >= c->node.header.nritems) {