diff options
author | Chris Mason <chris.mason@oracle.com> | 2011-05-22 12:33:42 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2011-05-22 12:33:42 -0400 |
commit | 945d8962ceee6bb273365d0bdf42f763225b290f (patch) | |
tree | 43f5617022c7c947c3c63664e49eb9575ab82f2f /fs/btrfs/relocation.c | |
parent | 0d0ca30f180906224be6279788f2b202cfd959d8 (diff) | |
parent | 4ea028859bbdad34b84c9951fbb832ae10c6a96c (diff) |
Merge branch 'cleanups' of git://repo.or.cz/linux-2.6/btrfs-unstable into inode_numbers
Conflicts:
fs/btrfs/extent-tree.c
fs/btrfs/free-space-cache.c
fs/btrfs/inode.c
fs/btrfs/tree-log.c
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/relocation.c')
-rw-r--r-- | fs/btrfs/relocation.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c index 4b5b91cf48e2..051992c7fcc9 100644 --- a/fs/btrfs/relocation.c +++ b/fs/btrfs/relocation.c | |||
@@ -508,6 +508,7 @@ static int update_backref_cache(struct btrfs_trans_handle *trans, | |||
508 | return 1; | 508 | return 1; |
509 | } | 509 | } |
510 | 510 | ||
511 | |||
511 | static int should_ignore_root(struct btrfs_root *root) | 512 | static int should_ignore_root(struct btrfs_root *root) |
512 | { | 513 | { |
513 | struct btrfs_root *reloc_root; | 514 | struct btrfs_root *reloc_root; |
@@ -530,7 +531,6 @@ static int should_ignore_root(struct btrfs_root *root) | |||
530 | */ | 531 | */ |
531 | return 1; | 532 | return 1; |
532 | } | 533 | } |
533 | |||
534 | /* | 534 | /* |
535 | * find reloc tree by address of tree root | 535 | * find reloc tree by address of tree root |
536 | */ | 536 | */ |
@@ -962,7 +962,7 @@ again: | |||
962 | lower = upper; | 962 | lower = upper; |
963 | upper = NULL; | 963 | upper = NULL; |
964 | } | 964 | } |
965 | btrfs_release_path(root, path2); | 965 | btrfs_release_path(path2); |
966 | next: | 966 | next: |
967 | if (ptr < end) { | 967 | if (ptr < end) { |
968 | ptr += btrfs_extent_inline_ref_size(key.type); | 968 | ptr += btrfs_extent_inline_ref_size(key.type); |
@@ -975,7 +975,7 @@ next: | |||
975 | if (ptr >= end) | 975 | if (ptr >= end) |
976 | path1->slots[0]++; | 976 | path1->slots[0]++; |
977 | } | 977 | } |
978 | btrfs_release_path(rc->extent_root, path1); | 978 | btrfs_release_path(path1); |
979 | 979 | ||
980 | cur->checked = 1; | 980 | cur->checked = 1; |
981 | WARN_ON(exist); | 981 | WARN_ON(exist); |
@@ -1750,7 +1750,7 @@ again: | |||
1750 | 1750 | ||
1751 | btrfs_node_key_to_cpu(path->nodes[level], &key, | 1751 | btrfs_node_key_to_cpu(path->nodes[level], &key, |
1752 | path->slots[level]); | 1752 | path->slots[level]); |
1753 | btrfs_release_path(src, path); | 1753 | btrfs_release_path(path); |
1754 | 1754 | ||
1755 | path->lowest_level = level; | 1755 | path->lowest_level = level; |
1756 | ret = btrfs_search_slot(trans, src, &key, path, 0, 1); | 1756 | ret = btrfs_search_slot(trans, src, &key, path, 0, 1); |
@@ -2499,7 +2499,7 @@ static int do_relocation(struct btrfs_trans_handle *trans, | |||
2499 | path->locks[upper->level] = 0; | 2499 | path->locks[upper->level] = 0; |
2500 | 2500 | ||
2501 | slot = path->slots[upper->level]; | 2501 | slot = path->slots[upper->level]; |
2502 | btrfs_release_path(NULL, path); | 2502 | btrfs_release_path(path); |
2503 | } else { | 2503 | } else { |
2504 | ret = btrfs_bin_search(upper->eb, key, upper->level, | 2504 | ret = btrfs_bin_search(upper->eb, key, upper->level, |
2505 | &slot); | 2505 | &slot); |
@@ -2740,7 +2740,7 @@ static int relocate_tree_block(struct btrfs_trans_handle *trans, | |||
2740 | } else { | 2740 | } else { |
2741 | path->lowest_level = node->level; | 2741 | path->lowest_level = node->level; |
2742 | ret = btrfs_search_slot(trans, root, key, path, 0, 1); | 2742 | ret = btrfs_search_slot(trans, root, key, path, 0, 1); |
2743 | btrfs_release_path(root, path); | 2743 | btrfs_release_path(path); |
2744 | if (ret > 0) | 2744 | if (ret > 0) |
2745 | ret = 0; | 2745 | ret = 0; |
2746 | } | 2746 | } |
@@ -2873,7 +2873,7 @@ int setup_extent_mapping(struct inode *inode, u64 start, u64 end, | |||
2873 | struct extent_map *em; | 2873 | struct extent_map *em; |
2874 | int ret = 0; | 2874 | int ret = 0; |
2875 | 2875 | ||
2876 | em = alloc_extent_map(GFP_NOFS); | 2876 | em = alloc_extent_map(); |
2877 | if (!em) | 2877 | if (!em) |
2878 | return -ENOMEM; | 2878 | return -ENOMEM; |
2879 | 2879 | ||
@@ -3122,7 +3122,7 @@ static int add_tree_block(struct reloc_control *rc, | |||
3122 | #endif | 3122 | #endif |
3123 | } | 3123 | } |
3124 | 3124 | ||
3125 | btrfs_release_path(rc->extent_root, path); | 3125 | btrfs_release_path(path); |
3126 | 3126 | ||
3127 | BUG_ON(level == -1); | 3127 | BUG_ON(level == -1); |
3128 | 3128 | ||
@@ -3223,7 +3223,7 @@ static int delete_block_group_cache(struct btrfs_fs_info *fs_info, | |||
3223 | key.offset = 0; | 3223 | key.offset = 0; |
3224 | 3224 | ||
3225 | inode = btrfs_iget(fs_info->sb, &key, root, NULL); | 3225 | inode = btrfs_iget(fs_info->sb, &key, root, NULL); |
3226 | if (!inode || IS_ERR(inode) || is_bad_inode(inode)) { | 3226 | if (IS_ERR_OR_NULL(inode) || is_bad_inode(inode)) { |
3227 | if (inode && !IS_ERR(inode)) | 3227 | if (inode && !IS_ERR(inode)) |
3228 | iput(inode); | 3228 | iput(inode); |
3229 | return -ENOENT; | 3229 | return -ENOENT; |
@@ -3508,7 +3508,7 @@ int add_data_references(struct reloc_control *rc, | |||
3508 | } | 3508 | } |
3509 | path->slots[0]++; | 3509 | path->slots[0]++; |
3510 | } | 3510 | } |
3511 | btrfs_release_path(rc->extent_root, path); | 3511 | btrfs_release_path(path); |
3512 | if (err) | 3512 | if (err) |
3513 | free_block_list(blocks); | 3513 | free_block_list(blocks); |
3514 | return err; | 3514 | return err; |
@@ -3571,7 +3571,7 @@ next: | |||
3571 | EXTENT_DIRTY); | 3571 | EXTENT_DIRTY); |
3572 | 3572 | ||
3573 | if (ret == 0 && start <= key.objectid) { | 3573 | if (ret == 0 && start <= key.objectid) { |
3574 | btrfs_release_path(rc->extent_root, path); | 3574 | btrfs_release_path(path); |
3575 | rc->search_start = end + 1; | 3575 | rc->search_start = end + 1; |
3576 | } else { | 3576 | } else { |
3577 | rc->search_start = key.objectid + key.offset; | 3577 | rc->search_start = key.objectid + key.offset; |
@@ -3579,7 +3579,7 @@ next: | |||
3579 | return 0; | 3579 | return 0; |
3580 | } | 3580 | } |
3581 | } | 3581 | } |
3582 | btrfs_release_path(rc->extent_root, path); | 3582 | btrfs_release_path(path); |
3583 | return ret; | 3583 | return ret; |
3584 | } | 3584 | } |
3585 | 3585 | ||
@@ -3716,7 +3716,7 @@ restart: | |||
3716 | flags = BTRFS_EXTENT_FLAG_DATA; | 3716 | flags = BTRFS_EXTENT_FLAG_DATA; |
3717 | 3717 | ||
3718 | if (path_change) { | 3718 | if (path_change) { |
3719 | btrfs_release_path(rc->extent_root, path); | 3719 | btrfs_release_path(path); |
3720 | 3720 | ||
3721 | path->search_commit_root = 1; | 3721 | path->search_commit_root = 1; |
3722 | path->skip_locking = 1; | 3722 | path->skip_locking = 1; |
@@ -3739,7 +3739,7 @@ restart: | |||
3739 | (flags & BTRFS_EXTENT_FLAG_DATA)) { | 3739 | (flags & BTRFS_EXTENT_FLAG_DATA)) { |
3740 | ret = add_data_references(rc, &key, path, &blocks); | 3740 | ret = add_data_references(rc, &key, path, &blocks); |
3741 | } else { | 3741 | } else { |
3742 | btrfs_release_path(rc->extent_root, path); | 3742 | btrfs_release_path(path); |
3743 | ret = 0; | 3743 | ret = 0; |
3744 | } | 3744 | } |
3745 | if (ret < 0) { | 3745 | if (ret < 0) { |
@@ -3802,7 +3802,7 @@ restart: | |||
3802 | } | 3802 | } |
3803 | } | 3803 | } |
3804 | 3804 | ||
3805 | btrfs_release_path(rc->extent_root, path); | 3805 | btrfs_release_path(path); |
3806 | clear_extent_bits(&rc->processed_blocks, 0, (u64)-1, EXTENT_DIRTY, | 3806 | clear_extent_bits(&rc->processed_blocks, 0, (u64)-1, EXTENT_DIRTY, |
3807 | GFP_NOFS); | 3807 | GFP_NOFS); |
3808 | 3808 | ||
@@ -3870,7 +3870,7 @@ static int __insert_orphan_inode(struct btrfs_trans_handle *trans, | |||
3870 | btrfs_set_inode_flags(leaf, item, BTRFS_INODE_NOCOMPRESS | | 3870 | btrfs_set_inode_flags(leaf, item, BTRFS_INODE_NOCOMPRESS | |
3871 | BTRFS_INODE_PREALLOC); | 3871 | BTRFS_INODE_PREALLOC); |
3872 | btrfs_mark_buffer_dirty(leaf); | 3872 | btrfs_mark_buffer_dirty(leaf); |
3873 | btrfs_release_path(root, path); | 3873 | btrfs_release_path(path); |
3874 | out: | 3874 | out: |
3875 | btrfs_free_path(path); | 3875 | btrfs_free_path(path); |
3876 | return ret; | 3876 | return ret; |
@@ -3938,7 +3938,7 @@ static struct reloc_control *alloc_reloc_control(void) | |||
3938 | INIT_LIST_HEAD(&rc->reloc_roots); | 3938 | INIT_LIST_HEAD(&rc->reloc_roots); |
3939 | backref_cache_init(&rc->backref_cache); | 3939 | backref_cache_init(&rc->backref_cache); |
3940 | mapping_tree_init(&rc->reloc_root_tree); | 3940 | mapping_tree_init(&rc->reloc_root_tree); |
3941 | extent_io_tree_init(&rc->processed_blocks, NULL, GFP_NOFS); | 3941 | extent_io_tree_init(&rc->processed_blocks, NULL); |
3942 | return rc; | 3942 | return rc; |
3943 | } | 3943 | } |
3944 | 3944 | ||
@@ -4112,7 +4112,7 @@ int btrfs_recover_relocation(struct btrfs_root *root) | |||
4112 | } | 4112 | } |
4113 | leaf = path->nodes[0]; | 4113 | leaf = path->nodes[0]; |
4114 | btrfs_item_key_to_cpu(leaf, &key, path->slots[0]); | 4114 | btrfs_item_key_to_cpu(leaf, &key, path->slots[0]); |
4115 | btrfs_release_path(root->fs_info->tree_root, path); | 4115 | btrfs_release_path(path); |
4116 | 4116 | ||
4117 | if (key.objectid != BTRFS_TREE_RELOC_OBJECTID || | 4117 | if (key.objectid != BTRFS_TREE_RELOC_OBJECTID || |
4118 | key.type != BTRFS_ROOT_ITEM_KEY) | 4118 | key.type != BTRFS_ROOT_ITEM_KEY) |
@@ -4144,7 +4144,7 @@ int btrfs_recover_relocation(struct btrfs_root *root) | |||
4144 | 4144 | ||
4145 | key.offset--; | 4145 | key.offset--; |
4146 | } | 4146 | } |
4147 | btrfs_release_path(root->fs_info->tree_root, path); | 4147 | btrfs_release_path(path); |
4148 | 4148 | ||
4149 | if (list_empty(&reloc_roots)) | 4149 | if (list_empty(&reloc_roots)) |
4150 | goto out; | 4150 | goto out; |