diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/ctree.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index 2b960278a2f9..2f633e751198 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c | |||
@@ -1052,8 +1052,7 @@ static noinline int balance_level(struct btrfs_trans_handle *trans, | |||
1052 | BTRFS_NODEPTRS_PER_BLOCK(root) / 4) | 1052 | BTRFS_NODEPTRS_PER_BLOCK(root) / 4) |
1053 | return 0; | 1053 | return 0; |
1054 | 1054 | ||
1055 | if (trans->transaction->delayed_refs.flushing && | 1055 | if (btrfs_header_nritems(mid) > 2) |
1056 | btrfs_header_nritems(mid) > 2) | ||
1057 | return 0; | 1056 | return 0; |
1058 | 1057 | ||
1059 | if (btrfs_header_nritems(mid) < 2) | 1058 | if (btrfs_header_nritems(mid) < 2) |
@@ -2194,7 +2193,7 @@ static noinline int split_node(struct btrfs_trans_handle *trans, | |||
2194 | ret = insert_new_root(trans, root, path, level + 1); | 2193 | ret = insert_new_root(trans, root, path, level + 1); |
2195 | if (ret) | 2194 | if (ret) |
2196 | return ret; | 2195 | return ret; |
2197 | } else if (!trans->transaction->delayed_refs.flushing) { | 2196 | } else { |
2198 | ret = push_nodes_for_insert(trans, root, path, level); | 2197 | ret = push_nodes_for_insert(trans, root, path, level); |
2199 | c = path->nodes[level]; | 2198 | c = path->nodes[level]; |
2200 | if (!ret && btrfs_header_nritems(c) < | 2199 | if (!ret && btrfs_header_nritems(c) < |
@@ -2869,8 +2868,7 @@ static noinline int split_leaf(struct btrfs_trans_handle *trans, | |||
2869 | int num_doubles = 0; | 2868 | int num_doubles = 0; |
2870 | 2869 | ||
2871 | /* first try to make some room by pushing left and right */ | 2870 | /* first try to make some room by pushing left and right */ |
2872 | if (data_size && ins_key->type != BTRFS_DIR_ITEM_KEY && | 2871 | if (data_size && ins_key->type != BTRFS_DIR_ITEM_KEY) { |
2873 | !trans->transaction->delayed_refs.flushing) { | ||
2874 | wret = push_leaf_right(trans, root, path, data_size, 0); | 2872 | wret = push_leaf_right(trans, root, path, data_size, 0); |
2875 | if (wret < 0) | 2873 | if (wret < 0) |
2876 | return wret; | 2874 | return wret; |
@@ -3809,8 +3807,7 @@ int btrfs_del_items(struct btrfs_trans_handle *trans, struct btrfs_root *root, | |||
3809 | } | 3807 | } |
3810 | 3808 | ||
3811 | /* delete the leaf if it is mostly empty */ | 3809 | /* delete the leaf if it is mostly empty */ |
3812 | if (used < BTRFS_LEAF_DATA_SIZE(root) / 4 && | 3810 | if (used < BTRFS_LEAF_DATA_SIZE(root) / 4) { |
3813 | !trans->transaction->delayed_refs.flushing) { | ||
3814 | /* push_leaf_left fixes the path. | 3811 | /* push_leaf_left fixes the path. |
3815 | * make sure the path still points to our leaf | 3812 | * make sure the path still points to our leaf |
3816 | * for possible call to del_ptr below | 3813 | * for possible call to del_ptr below |