diff options
author | Chris Mason <chris.mason@oracle.com> | 2007-03-02 09:47:58 -0500 |
---|---|---|
committer | David Woodhouse <dwmw2@hera.kernel.org> | 2007-03-02 09:47:58 -0500 |
commit | f0930a37f1c096c3a8f6a17b1e251c7fdf4d4457 (patch) | |
tree | 51b569606b25cd5ef903f9ef97734a1f6ec291d2 /fs/btrfs/ctree.c | |
parent | ed2ff2cba766dfe7976a0113f667c9a0a50dff02 (diff) |
Btrfs: 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
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/ctree.c')
-rw-r--r-- | fs/btrfs/ctree.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index 57fa505fb9f6..3c5f4c2dd525 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c | |||
@@ -1065,11 +1065,7 @@ int insert_item(struct ctree_root *root, struct key *key, | |||
1065 | ret = search_slot(root, key, &path, data_size); | 1065 | ret = search_slot(root, key, &path, data_size); |
1066 | if (ret == 0) { | 1066 | if (ret == 0) { |
1067 | release_path(root, &path); | 1067 | release_path(root, &path); |
1068 | ret = -EEXIST; | 1068 | return -EEXIST; |
1069 | wret = commit_transaction(root); | ||
1070 | if (wret) | ||
1071 | ret = wret; | ||
1072 | return ret; | ||
1073 | } | 1069 | } |
1074 | if (ret < 0) | 1070 | if (ret < 0) |
1075 | goto out; | 1071 | goto out; |
@@ -1127,9 +1123,6 @@ int insert_item(struct ctree_root *root, struct key *key, | |||
1127 | check_leaf(&path, 0); | 1123 | check_leaf(&path, 0); |
1128 | out: | 1124 | out: |
1129 | release_path(root, &path); | 1125 | release_path(root, &path); |
1130 | wret = commit_transaction(root); | ||
1131 | if (wret) | ||
1132 | ret = wret; | ||
1133 | return ret; | 1126 | return ret; |
1134 | } | 1127 | } |
1135 | 1128 | ||
@@ -1245,7 +1238,8 @@ int del_item(struct ctree_root *root, struct ctree_path *path) | |||
1245 | wret = push_leaf_left(root, path, 1); | 1238 | wret = push_leaf_left(root, path, 1); |
1246 | if (wret < 0) | 1239 | if (wret < 0) |
1247 | ret = wret; | 1240 | ret = wret; |
1248 | if (leaf->header.nritems) { | 1241 | if (path->nodes[0] == leaf_buf && |
1242 | leaf->header.nritems) { | ||
1249 | wret = push_leaf_right(root, path, 1); | 1243 | wret = push_leaf_right(root, path, 1); |
1250 | if (wret < 0) | 1244 | if (wret < 0) |
1251 | ret = wret; | 1245 | ret = wret; |
@@ -1265,9 +1259,6 @@ int del_item(struct ctree_root *root, struct ctree_path *path) | |||
1265 | } | 1259 | } |
1266 | } | 1260 | } |
1267 | } | 1261 | } |
1268 | wret = commit_transaction(root); | ||
1269 | if (wret) | ||
1270 | ret = wret; | ||
1271 | return ret; | 1262 | return ret; |
1272 | } | 1263 | } |
1273 | 1264 | ||