diff options
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r-- | fs/btrfs/extent-tree.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 73f6dd2cf3cb..44b529f183e3 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c | |||
@@ -3448,7 +3448,7 @@ again: | |||
3448 | 3448 | ||
3449 | spin_lock(&block_group->lock); | 3449 | spin_lock(&block_group->lock); |
3450 | if (block_group->cached != BTRFS_CACHE_FINISHED || | 3450 | if (block_group->cached != BTRFS_CACHE_FINISHED || |
3451 | !btrfs_test_opt(root, SPACE_CACHE)) { | 3451 | !btrfs_test_opt(root->fs_info, SPACE_CACHE)) { |
3452 | /* | 3452 | /* |
3453 | * don't bother trying to write stuff out _if_ | 3453 | * don't bother trying to write stuff out _if_ |
3454 | * a) we're not cached, | 3454 | * a) we're not cached, |
@@ -3525,7 +3525,7 @@ int btrfs_setup_space_cache(struct btrfs_trans_handle *trans, | |||
3525 | struct btrfs_path *path; | 3525 | struct btrfs_path *path; |
3526 | 3526 | ||
3527 | if (list_empty(&cur_trans->dirty_bgs) || | 3527 | if (list_empty(&cur_trans->dirty_bgs) || |
3528 | !btrfs_test_opt(root, SPACE_CACHE)) | 3528 | !btrfs_test_opt(root->fs_info, SPACE_CACHE)) |
3529 | return 0; | 3529 | return 0; |
3530 | 3530 | ||
3531 | path = btrfs_alloc_path(); | 3531 | path = btrfs_alloc_path(); |
@@ -4444,7 +4444,7 @@ void check_system_chunk(struct btrfs_trans_handle *trans, | |||
4444 | thresh = btrfs_calc_trunc_metadata_size(root, num_devs) + | 4444 | thresh = btrfs_calc_trunc_metadata_size(root, num_devs) + |
4445 | btrfs_calc_trans_metadata_size(root, 1); | 4445 | btrfs_calc_trans_metadata_size(root, 1); |
4446 | 4446 | ||
4447 | if (left < thresh && btrfs_test_opt(root, ENOSPC_DEBUG)) { | 4447 | if (left < thresh && btrfs_test_opt(root->fs_info, ENOSPC_DEBUG)) { |
4448 | btrfs_info(root->fs_info, "left=%llu, need=%llu, flags=%llu", | 4448 | btrfs_info(root->fs_info, "left=%llu, need=%llu, flags=%llu", |
4449 | left, thresh, type); | 4449 | left, thresh, type); |
4450 | dump_space_info(info, 0, 0); | 4450 | dump_space_info(info, 0, 0); |
@@ -6216,7 +6216,7 @@ static int update_block_group(struct btrfs_trans_handle *trans, | |||
6216 | spin_lock(&cache->space_info->lock); | 6216 | spin_lock(&cache->space_info->lock); |
6217 | spin_lock(&cache->lock); | 6217 | spin_lock(&cache->lock); |
6218 | 6218 | ||
6219 | if (btrfs_test_opt(root, SPACE_CACHE) && | 6219 | if (btrfs_test_opt(root->fs_info, SPACE_CACHE) && |
6220 | cache->disk_cache_state < BTRFS_DC_CLEAR) | 6220 | cache->disk_cache_state < BTRFS_DC_CLEAR) |
6221 | cache->disk_cache_state = BTRFS_DC_CLEAR; | 6221 | cache->disk_cache_state = BTRFS_DC_CLEAR; |
6222 | 6222 | ||
@@ -6598,7 +6598,7 @@ fetch_cluster_info(struct btrfs_root *root, struct btrfs_space_info *space_info, | |||
6598 | u64 *empty_cluster) | 6598 | u64 *empty_cluster) |
6599 | { | 6599 | { |
6600 | struct btrfs_free_cluster *ret = NULL; | 6600 | struct btrfs_free_cluster *ret = NULL; |
6601 | bool ssd = btrfs_test_opt(root, SSD); | 6601 | bool ssd = btrfs_test_opt(root->fs_info, SSD); |
6602 | 6602 | ||
6603 | *empty_cluster = 0; | 6603 | *empty_cluster = 0; |
6604 | if (btrfs_mixed_space_info(space_info)) | 6604 | if (btrfs_mixed_space_info(space_info)) |
@@ -6743,7 +6743,7 @@ int btrfs_finish_extent_commit(struct btrfs_trans_handle *trans, | |||
6743 | break; | 6743 | break; |
6744 | } | 6744 | } |
6745 | 6745 | ||
6746 | if (btrfs_test_opt(root, DISCARD)) | 6746 | if (btrfs_test_opt(root->fs_info, DISCARD)) |
6747 | ret = btrfs_discard_extent(root, start, | 6747 | ret = btrfs_discard_extent(root, start, |
6748 | end + 1 - start, NULL); | 6748 | end + 1 - start, NULL); |
6749 | 6749 | ||
@@ -7962,7 +7962,7 @@ again: | |||
7962 | if (num_bytes == min_alloc_size) | 7962 | if (num_bytes == min_alloc_size) |
7963 | final_tried = true; | 7963 | final_tried = true; |
7964 | goto again; | 7964 | goto again; |
7965 | } else if (btrfs_test_opt(root, ENOSPC_DEBUG)) { | 7965 | } else if (btrfs_test_opt(root->fs_info, ENOSPC_DEBUG)) { |
7966 | struct btrfs_space_info *sinfo; | 7966 | struct btrfs_space_info *sinfo; |
7967 | 7967 | ||
7968 | sinfo = __find_space_info(root->fs_info, flags); | 7968 | sinfo = __find_space_info(root->fs_info, flags); |
@@ -7993,7 +7993,7 @@ static int __btrfs_free_reserved_extent(struct btrfs_root *root, | |||
7993 | if (pin) | 7993 | if (pin) |
7994 | pin_down_extent(root, cache, start, len, 1); | 7994 | pin_down_extent(root, cache, start, len, 1); |
7995 | else { | 7995 | else { |
7996 | if (btrfs_test_opt(root, DISCARD)) | 7996 | if (btrfs_test_opt(root->fs_info, DISCARD)) |
7997 | ret = btrfs_discard_extent(root, start, len, NULL); | 7997 | ret = btrfs_discard_extent(root, start, len, NULL); |
7998 | btrfs_add_free_space(cache, start, len); | 7998 | btrfs_add_free_space(cache, start, len); |
7999 | btrfs_update_reserved_bytes(cache, len, RESERVE_FREE, delalloc); | 7999 | btrfs_update_reserved_bytes(cache, len, RESERVE_FREE, delalloc); |
@@ -8301,7 +8301,7 @@ again: | |||
8301 | goto again; | 8301 | goto again; |
8302 | } | 8302 | } |
8303 | 8303 | ||
8304 | if (btrfs_test_opt(root, ENOSPC_DEBUG)) { | 8304 | if (btrfs_test_opt(root->fs_info, ENOSPC_DEBUG)) { |
8305 | static DEFINE_RATELIMIT_STATE(_rs, | 8305 | static DEFINE_RATELIMIT_STATE(_rs, |
8306 | DEFAULT_RATELIMIT_INTERVAL * 10, | 8306 | DEFAULT_RATELIMIT_INTERVAL * 10, |
8307 | /*DEFAULT_RATELIMIT_BURST*/ 1); | 8307 | /*DEFAULT_RATELIMIT_BURST*/ 1); |
@@ -9735,7 +9735,7 @@ int btrfs_can_relocate(struct btrfs_root *root, u64 bytenr) | |||
9735 | int full = 0; | 9735 | int full = 0; |
9736 | int ret = 0; | 9736 | int ret = 0; |
9737 | 9737 | ||
9738 | debug = btrfs_test_opt(root, ENOSPC_DEBUG); | 9738 | debug = btrfs_test_opt(root->fs_info, ENOSPC_DEBUG); |
9739 | 9739 | ||
9740 | block_group = btrfs_lookup_block_group(root->fs_info, bytenr); | 9740 | block_group = btrfs_lookup_block_group(root->fs_info, bytenr); |
9741 | 9741 | ||
@@ -10148,10 +10148,10 @@ int btrfs_read_block_groups(struct btrfs_root *root) | |||
10148 | path->reada = READA_FORWARD; | 10148 | path->reada = READA_FORWARD; |
10149 | 10149 | ||
10150 | cache_gen = btrfs_super_cache_generation(root->fs_info->super_copy); | 10150 | cache_gen = btrfs_super_cache_generation(root->fs_info->super_copy); |
10151 | if (btrfs_test_opt(root, SPACE_CACHE) && | 10151 | if (btrfs_test_opt(root->fs_info, SPACE_CACHE) && |
10152 | btrfs_super_generation(root->fs_info->super_copy) != cache_gen) | 10152 | btrfs_super_generation(root->fs_info->super_copy) != cache_gen) |
10153 | need_clear = 1; | 10153 | need_clear = 1; |
10154 | if (btrfs_test_opt(root, CLEAR_CACHE)) | 10154 | if (btrfs_test_opt(root->fs_info, CLEAR_CACHE)) |
10155 | need_clear = 1; | 10155 | need_clear = 1; |
10156 | 10156 | ||
10157 | while (1) { | 10157 | while (1) { |
@@ -10182,7 +10182,7 @@ int btrfs_read_block_groups(struct btrfs_root *root) | |||
10182 | * b) Setting 'dirty flag' makes sure that we flush | 10182 | * b) Setting 'dirty flag' makes sure that we flush |
10183 | * the new space cache info onto disk. | 10183 | * the new space cache info onto disk. |
10184 | */ | 10184 | */ |
10185 | if (btrfs_test_opt(root, SPACE_CACHE)) | 10185 | if (btrfs_test_opt(root->fs_info, SPACE_CACHE)) |
10186 | cache->disk_cache_state = BTRFS_DC_CLEAR; | 10186 | cache->disk_cache_state = BTRFS_DC_CLEAR; |
10187 | } | 10187 | } |
10188 | 10188 | ||
@@ -10641,7 +10641,7 @@ int btrfs_remove_block_group(struct btrfs_trans_handle *trans, | |||
10641 | spin_lock(&block_group->space_info->lock); | 10641 | spin_lock(&block_group->space_info->lock); |
10642 | list_del_init(&block_group->ro_list); | 10642 | list_del_init(&block_group->ro_list); |
10643 | 10643 | ||
10644 | if (btrfs_test_opt(root, ENOSPC_DEBUG)) { | 10644 | if (btrfs_test_opt(root->fs_info, ENOSPC_DEBUG)) { |
10645 | WARN_ON(block_group->space_info->total_bytes | 10645 | WARN_ON(block_group->space_info->total_bytes |
10646 | < block_group->key.offset); | 10646 | < block_group->key.offset); |
10647 | WARN_ON(block_group->space_info->bytes_readonly | 10647 | WARN_ON(block_group->space_info->bytes_readonly |
@@ -10909,7 +10909,7 @@ void btrfs_delete_unused_bgs(struct btrfs_fs_info *fs_info) | |||
10909 | spin_unlock(&space_info->lock); | 10909 | spin_unlock(&space_info->lock); |
10910 | 10910 | ||
10911 | /* DISCARD can flip during remount */ | 10911 | /* DISCARD can flip during remount */ |
10912 | trimming = btrfs_test_opt(root, DISCARD); | 10912 | trimming = btrfs_test_opt(root->fs_info, DISCARD); |
10913 | 10913 | ||
10914 | /* Implicit trim during transaction commit. */ | 10914 | /* Implicit trim during transaction commit. */ |
10915 | if (trimming) | 10915 | if (trimming) |