summaryrefslogtreecommitdiff
path: root/ctree.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2007-03-02 09:47:58 -0500
committerDavid Woodhouse <dwmw2@hera.kernel.org>2007-03-02 09:47:58 -0500
commit11bc1cd2a565ab90f16dba2da40cba5e30128783 (patch)
tree4aff9b22200638211981451bbae62fd138a19581 /ctree.c
parenta71a25da6968d3b681a04f5f9289a2ea4e192a79 (diff)
Fix extent code to use merge during delete
Remove implicit commit in del_item and insert_item Add implicit commit to close() Add commit op in random-test
Diffstat (limited to 'ctree.c')
-rw-r--r--ctree.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/ctree.c b/ctree.c
index 57fa505f..3c5f4c2d 100644
--- a/ctree.c
+++ b/ctree.c
@@ -1065,11 +1065,7 @@ int insert_item(struct ctree_root *root, struct key *key,
ret = search_slot(root, key, &path, data_size);
if (ret == 0) {
release_path(root, &path);
- ret = -EEXIST;
- wret = commit_transaction(root);
- if (wret)
- ret = wret;
- return ret;
+ return -EEXIST;
}
if (ret < 0)
goto out;
@@ -1127,9 +1123,6 @@ int insert_item(struct ctree_root *root, struct key *key,
check_leaf(&path, 0);
out:
release_path(root, &path);
- wret = commit_transaction(root);
- if (wret)
- ret = wret;
return ret;
}
@@ -1245,7 +1238,8 @@ int del_item(struct ctree_root *root, struct ctree_path *path)
wret = push_leaf_left(root, path, 1);
if (wret < 0)
ret = wret;
- if (leaf->header.nritems) {
+ if (path->nodes[0] == leaf_buf &&
+ leaf->header.nritems) {
wret = push_leaf_right(root, path, 1);
if (wret < 0)
ret = wret;
@@ -1265,9 +1259,6 @@ int del_item(struct ctree_root *root, struct ctree_path *path)
}
}
}
- wret = commit_transaction(root);
- if (wret)
- ret = wret;
return ret;
}