Commit 43a7e99d authored by Nikolay Borisov's avatar Nikolay Borisov Committed by David Sterba
Browse files

btrfs: Remove fs_info from btrfs_force_chunk_alloc



It can be referenced from the passed transaction handle.

Signed-off-by: default avatarNikolay Borisov <nborisov@suse.com>
Reviewed-by: default avatarQu Wenruo <wqu@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent c83488af
Loading
Loading
Loading
Loading
+1 −2
Original line number Original line Diff line number Diff line
@@ -2809,8 +2809,7 @@ int btrfs_error_unpin_extent_range(struct btrfs_fs_info *fs_info,
				   u64 start, u64 end);
				   u64 start, u64 end);
int btrfs_discard_extent(struct btrfs_fs_info *fs_info, u64 bytenr,
int btrfs_discard_extent(struct btrfs_fs_info *fs_info, u64 bytenr,
			 u64 num_bytes, u64 *actual_bytes);
			 u64 num_bytes, u64 *actual_bytes);
int btrfs_force_chunk_alloc(struct btrfs_trans_handle *trans,
int btrfs_force_chunk_alloc(struct btrfs_trans_handle *trans, u64 type);
			    struct btrfs_fs_info *fs_info, u64 type);
int btrfs_trim_fs(struct btrfs_fs_info *fs_info, struct fstrim_range *range);
int btrfs_trim_fs(struct btrfs_fs_info *fs_info, struct fstrim_range *range);


int btrfs_init_space_info(struct btrfs_fs_info *fs_info);
int btrfs_init_space_info(struct btrfs_fs_info *fs_info);
+2 −3
Original line number Original line Diff line number Diff line
@@ -9497,10 +9497,9 @@ int btrfs_inc_block_group_ro(struct btrfs_block_group_cache *cache)
	return ret;
	return ret;
}
}


int btrfs_force_chunk_alloc(struct btrfs_trans_handle *trans,
int btrfs_force_chunk_alloc(struct btrfs_trans_handle *trans, u64 type)
			    struct btrfs_fs_info *fs_info, u64 type)
{
{
	u64 alloc_flags = get_alloc_profile(fs_info, type);
	u64 alloc_flags = get_alloc_profile(trans->fs_info, type);


	return do_chunk_alloc(trans, alloc_flags, CHUNK_ALLOC_FORCE);
	return do_chunk_alloc(trans, alloc_flags, CHUNK_ALLOC_FORCE);
}
}
+1 −2
Original line number Original line Diff line number Diff line
@@ -4169,8 +4169,7 @@ static noinline_for_stack int relocate_block_group(struct reloc_control *rc)
		}
		}
	}
	}
	if (trans && progress && err == -ENOSPC) {
	if (trans && progress && err == -ENOSPC) {
		ret = btrfs_force_chunk_alloc(trans, fs_info,
		ret = btrfs_force_chunk_alloc(trans, rc->block_group->flags);
					      rc->block_group->flags);
		if (ret == 1) {
		if (ret == 1) {
			err = 0;
			err = 0;
			progress = 0;
			progress = 0;
+1 −1
Original line number Original line Diff line number Diff line
@@ -3059,7 +3059,7 @@ static int btrfs_may_alloc_data_chunk(struct btrfs_fs_info *fs_info,
			if (IS_ERR(trans))
			if (IS_ERR(trans))
				return PTR_ERR(trans);
				return PTR_ERR(trans);


			ret = btrfs_force_chunk_alloc(trans, fs_info,
			ret = btrfs_force_chunk_alloc(trans,
						      BTRFS_BLOCK_GROUP_DATA);
						      BTRFS_BLOCK_GROUP_DATA);
			btrfs_end_transaction(trans);
			btrfs_end_transaction(trans);
			if (ret < 0)
			if (ret < 0)