aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/volumes.c
diff options
context:
space:
mode:
authorZhao Lei <zhaolei@cn.fujitsu.com>2015-02-09 07:31:44 -0500
committerDavid Sterba <dsterba@suse.cz>2015-02-16 12:48:44 -0500
commita688a04aab72a775e07fe460f563b46f7791cfc1 (patch)
tree3a36507f50a077878c1403e8dfb931c08283f609 /fs/btrfs/volumes.c
parentb9fd47cde5dd9725ca37769861b7424f40828492 (diff)
btrfs: remove unused chunk_tree argument in several functions
There functions include unused chunk_tree argument from the begining, it is time to remove them and clean up relative code to prepare value of this argument in caller. Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'fs/btrfs/volumes.c')
-rw-r--r--fs/btrfs/volumes.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 33ed9df08a9c..30c6074f3d00 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -2487,8 +2487,7 @@ int btrfs_grow_device(struct btrfs_trans_handle *trans,
2487} 2487}
2488 2488
2489static int btrfs_free_chunk(struct btrfs_trans_handle *trans, 2489static int btrfs_free_chunk(struct btrfs_trans_handle *trans,
2490 struct btrfs_root *root, 2490 struct btrfs_root *root, u64 chunk_objectid,
2491 u64 chunk_tree, u64 chunk_objectid,
2492 u64 chunk_offset) 2491 u64 chunk_offset)
2493{ 2492{
2494 int ret; 2493 int ret;
@@ -2580,7 +2579,6 @@ int btrfs_remove_chunk(struct btrfs_trans_handle *trans,
2580 struct map_lookup *map; 2579 struct map_lookup *map;
2581 u64 dev_extent_len = 0; 2580 u64 dev_extent_len = 0;
2582 u64 chunk_objectid = BTRFS_FIRST_CHUNK_TREE_OBJECTID; 2581 u64 chunk_objectid = BTRFS_FIRST_CHUNK_TREE_OBJECTID;
2583 u64 chunk_tree = root->fs_info->chunk_root->objectid;
2584 int i, ret = 0; 2582 int i, ret = 0;
2585 2583
2586 /* Just in case */ 2584 /* Just in case */
@@ -2634,8 +2632,7 @@ int btrfs_remove_chunk(struct btrfs_trans_handle *trans,
2634 } 2632 }
2635 } 2633 }
2636 } 2634 }
2637 ret = btrfs_free_chunk(trans, root, chunk_tree, chunk_objectid, 2635 ret = btrfs_free_chunk(trans, root, chunk_objectid, chunk_offset);
2638 chunk_offset);
2639 if (ret) { 2636 if (ret) {
2640 btrfs_abort_transaction(trans, root, ret); 2637 btrfs_abort_transaction(trans, root, ret);
2641 goto out; 2638 goto out;
@@ -2664,8 +2661,8 @@ out:
2664} 2661}
2665 2662
2666static int btrfs_relocate_chunk(struct btrfs_root *root, 2663static int btrfs_relocate_chunk(struct btrfs_root *root,
2667 u64 chunk_tree, u64 chunk_objectid, 2664 u64 chunk_objectid,
2668 u64 chunk_offset) 2665 u64 chunk_offset)
2669{ 2666{
2670 struct btrfs_root *extent_root; 2667 struct btrfs_root *extent_root;
2671 struct btrfs_trans_handle *trans; 2668 struct btrfs_trans_handle *trans;
@@ -2707,7 +2704,6 @@ static int btrfs_relocate_sys_chunks(struct btrfs_root *root)
2707 struct btrfs_chunk *chunk; 2704 struct btrfs_chunk *chunk;
2708 struct btrfs_key key; 2705 struct btrfs_key key;
2709 struct btrfs_key found_key; 2706 struct btrfs_key found_key;
2710 u64 chunk_tree = chunk_root->root_key.objectid;
2711 u64 chunk_type; 2707 u64 chunk_type;
2712 bool retried = false; 2708 bool retried = false;
2713 int failed = 0; 2709 int failed = 0;
@@ -2744,7 +2740,7 @@ again:
2744 btrfs_release_path(path); 2740 btrfs_release_path(path);
2745 2741
2746 if (chunk_type & BTRFS_BLOCK_GROUP_SYSTEM) { 2742 if (chunk_type & BTRFS_BLOCK_GROUP_SYSTEM) {
2747 ret = btrfs_relocate_chunk(chunk_root, chunk_tree, 2743 ret = btrfs_relocate_chunk(chunk_root,
2748 found_key.objectid, 2744 found_key.objectid,
2749 found_key.offset); 2745 found_key.offset);
2750 if (ret == -ENOSPC) 2746 if (ret == -ENOSPC)
@@ -3255,7 +3251,6 @@ again:
3255 } 3251 }
3256 3252
3257 ret = btrfs_relocate_chunk(chunk_root, 3253 ret = btrfs_relocate_chunk(chunk_root,
3258 chunk_root->root_key.objectid,
3259 found_key.objectid, 3254 found_key.objectid,
3260 found_key.offset); 3255 found_key.offset);
3261 if (ret && ret != -ENOSPC) 3256 if (ret && ret != -ENOSPC)
@@ -3957,7 +3952,6 @@ int btrfs_shrink_device(struct btrfs_device *device, u64 new_size)
3957 struct btrfs_dev_extent *dev_extent = NULL; 3952 struct btrfs_dev_extent *dev_extent = NULL;
3958 struct btrfs_path *path; 3953 struct btrfs_path *path;
3959 u64 length; 3954 u64 length;
3960 u64 chunk_tree;
3961 u64 chunk_objectid; 3955 u64 chunk_objectid;
3962 u64 chunk_offset; 3956 u64 chunk_offset;
3963 int ret; 3957 int ret;
@@ -4027,13 +4021,11 @@ again:
4027 break; 4021 break;
4028 } 4022 }
4029 4023
4030 chunk_tree = btrfs_dev_extent_chunk_tree(l, dev_extent);
4031 chunk_objectid = btrfs_dev_extent_chunk_objectid(l, dev_extent); 4024 chunk_objectid = btrfs_dev_extent_chunk_objectid(l, dev_extent);
4032 chunk_offset = btrfs_dev_extent_chunk_offset(l, dev_extent); 4025 chunk_offset = btrfs_dev_extent_chunk_offset(l, dev_extent);
4033 btrfs_release_path(path); 4026 btrfs_release_path(path);
4034 4027
4035 ret = btrfs_relocate_chunk(root, chunk_tree, chunk_objectid, 4028 ret = btrfs_relocate_chunk(root, chunk_objectid, chunk_offset);
4036 chunk_offset);
4037 if (ret && ret != -ENOSPC) 4029 if (ret && ret != -ENOSPC)
4038 goto done; 4030 goto done;
4039 if (ret == -ENOSPC) 4031 if (ret == -ENOSPC)