diff options
author | Jan Schmidt <list.btrfs@jan-o-sch.net> | 2012-06-21 05:01:06 -0400 |
---|---|---|
committer | Jan Schmidt <list.btrfs@jan-o-sch.net> | 2012-06-27 10:34:39 -0400 |
commit | c3e0696523862c48b4d8c73ffb2867e9db478338 (patch) | |
tree | d27ae3822f86dc2d30e460e9cc867daf479a2788 /fs | |
parent | 28da9fb4467f7a650cd31af6dfad3a4e4a3abf6e (diff) |
Btrfs: always put insert_ptr modifications into the tree mod log
Several callers of insert_ptr set the tree_mod_log parameter to 0 to avoid
addition to the tree mod log. In fact, we need all of those operations. This
commit simply removes the additional parameter and makes addition to the
tree mod log unconditional.
Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/ctree.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index 7d1e4fc5fb6a..e005d9b04616 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c | |||
@@ -2997,7 +2997,7 @@ static noinline int insert_new_root(struct btrfs_trans_handle *trans, | |||
2997 | static void insert_ptr(struct btrfs_trans_handle *trans, | 2997 | static void insert_ptr(struct btrfs_trans_handle *trans, |
2998 | struct btrfs_root *root, struct btrfs_path *path, | 2998 | struct btrfs_root *root, struct btrfs_path *path, |
2999 | struct btrfs_disk_key *key, u64 bytenr, | 2999 | struct btrfs_disk_key *key, u64 bytenr, |
3000 | int slot, int level, int tree_mod_log) | 3000 | int slot, int level) |
3001 | { | 3001 | { |
3002 | struct extent_buffer *lower; | 3002 | struct extent_buffer *lower; |
3003 | int nritems; | 3003 | int nritems; |
@@ -3010,7 +3010,7 @@ static void insert_ptr(struct btrfs_trans_handle *trans, | |||
3010 | BUG_ON(slot > nritems); | 3010 | BUG_ON(slot > nritems); |
3011 | BUG_ON(nritems == BTRFS_NODEPTRS_PER_BLOCK(root)); | 3011 | BUG_ON(nritems == BTRFS_NODEPTRS_PER_BLOCK(root)); |
3012 | if (slot != nritems) { | 3012 | if (slot != nritems) { |
3013 | if (tree_mod_log && level) | 3013 | if (level) |
3014 | tree_mod_log_eb_move(root->fs_info, lower, slot + 1, | 3014 | tree_mod_log_eb_move(root->fs_info, lower, slot + 1, |
3015 | slot, nritems - slot); | 3015 | slot, nritems - slot); |
3016 | memmove_extent_buffer(lower, | 3016 | memmove_extent_buffer(lower, |
@@ -3018,7 +3018,7 @@ static void insert_ptr(struct btrfs_trans_handle *trans, | |||
3018 | btrfs_node_key_ptr_offset(slot), | 3018 | btrfs_node_key_ptr_offset(slot), |
3019 | (nritems - slot) * sizeof(struct btrfs_key_ptr)); | 3019 | (nritems - slot) * sizeof(struct btrfs_key_ptr)); |
3020 | } | 3020 | } |
3021 | if (tree_mod_log && level) { | 3021 | if (level) { |
3022 | ret = tree_mod_log_insert_key(root->fs_info, lower, slot, | 3022 | ret = tree_mod_log_insert_key(root->fs_info, lower, slot, |
3023 | MOD_LOG_KEY_ADD); | 3023 | MOD_LOG_KEY_ADD); |
3024 | BUG_ON(ret < 0); | 3024 | BUG_ON(ret < 0); |
@@ -3106,7 +3106,7 @@ static noinline int split_node(struct btrfs_trans_handle *trans, | |||
3106 | btrfs_mark_buffer_dirty(split); | 3106 | btrfs_mark_buffer_dirty(split); |
3107 | 3107 | ||
3108 | insert_ptr(trans, root, path, &disk_key, split->start, | 3108 | insert_ptr(trans, root, path, &disk_key, split->start, |
3109 | path->slots[level + 1] + 1, level + 1, 1); | 3109 | path->slots[level + 1] + 1, level + 1); |
3110 | 3110 | ||
3111 | if (path->slots[level] >= mid) { | 3111 | if (path->slots[level] >= mid) { |
3112 | path->slots[level] -= mid; | 3112 | path->slots[level] -= mid; |
@@ -3643,7 +3643,7 @@ static noinline void copy_for_split(struct btrfs_trans_handle *trans, | |||
3643 | btrfs_set_header_nritems(l, mid); | 3643 | btrfs_set_header_nritems(l, mid); |
3644 | btrfs_item_key(right, &disk_key, 0); | 3644 | btrfs_item_key(right, &disk_key, 0); |
3645 | insert_ptr(trans, root, path, &disk_key, right->start, | 3645 | insert_ptr(trans, root, path, &disk_key, right->start, |
3646 | path->slots[1] + 1, 1, 0); | 3646 | path->slots[1] + 1, 1); |
3647 | 3647 | ||
3648 | btrfs_mark_buffer_dirty(right); | 3648 | btrfs_mark_buffer_dirty(right); |
3649 | btrfs_mark_buffer_dirty(l); | 3649 | btrfs_mark_buffer_dirty(l); |
@@ -3850,7 +3850,7 @@ again: | |||
3850 | if (mid <= slot) { | 3850 | if (mid <= slot) { |
3851 | btrfs_set_header_nritems(right, 0); | 3851 | btrfs_set_header_nritems(right, 0); |
3852 | insert_ptr(trans, root, path, &disk_key, right->start, | 3852 | insert_ptr(trans, root, path, &disk_key, right->start, |
3853 | path->slots[1] + 1, 1, 0); | 3853 | path->slots[1] + 1, 1); |
3854 | btrfs_tree_unlock(path->nodes[0]); | 3854 | btrfs_tree_unlock(path->nodes[0]); |
3855 | free_extent_buffer(path->nodes[0]); | 3855 | free_extent_buffer(path->nodes[0]); |
3856 | path->nodes[0] = right; | 3856 | path->nodes[0] = right; |
@@ -3859,7 +3859,7 @@ again: | |||
3859 | } else { | 3859 | } else { |
3860 | btrfs_set_header_nritems(right, 0); | 3860 | btrfs_set_header_nritems(right, 0); |
3861 | insert_ptr(trans, root, path, &disk_key, right->start, | 3861 | insert_ptr(trans, root, path, &disk_key, right->start, |
3862 | path->slots[1], 1, 0); | 3862 | path->slots[1], 1); |
3863 | btrfs_tree_unlock(path->nodes[0]); | 3863 | btrfs_tree_unlock(path->nodes[0]); |
3864 | free_extent_buffer(path->nodes[0]); | 3864 | free_extent_buffer(path->nodes[0]); |
3865 | path->nodes[0] = right; | 3865 | path->nodes[0] = right; |