mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-07 14:32:23 +00:00
Btrfs: don't pass a trans handle unnecessarily in volumes.c
Some functions never use the transaction handle passed to them. Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
This commit is contained in:
parent
4da6f1a332
commit
125ccb0ae6
@ -7084,7 +7084,7 @@ int btrfs_can_relocate(struct btrfs_root *root, u64 bytenr)
|
||||
* space to fit our block group in.
|
||||
*/
|
||||
if (device->total_bytes > device->bytes_used + min_free) {
|
||||
ret = find_free_dev_extent(NULL, device, min_free,
|
||||
ret = find_free_dev_extent(device, min_free,
|
||||
&dev_offset, NULL);
|
||||
if (!ret)
|
||||
dev_nr++;
|
||||
|
@ -829,7 +829,6 @@ int btrfs_account_dev_extents_size(struct btrfs_device *device, u64 start,
|
||||
|
||||
/*
|
||||
* find_free_dev_extent - find free space in the specified device
|
||||
* @trans: transaction handler
|
||||
* @device: the device which we search the free space in
|
||||
* @num_bytes: the size of the free space that we need
|
||||
* @start: store the start of the free space.
|
||||
@ -848,8 +847,7 @@ int btrfs_account_dev_extents_size(struct btrfs_device *device, u64 start,
|
||||
* But if we don't find suitable free space, it is used to store the size of
|
||||
* the max free space.
|
||||
*/
|
||||
int find_free_dev_extent(struct btrfs_trans_handle *trans,
|
||||
struct btrfs_device *device, u64 num_bytes,
|
||||
int find_free_dev_extent(struct btrfs_device *device, u64 num_bytes,
|
||||
u64 *start, u64 *len)
|
||||
{
|
||||
struct btrfs_key key;
|
||||
@ -893,7 +891,7 @@ int find_free_dev_extent(struct btrfs_trans_handle *trans,
|
||||
key.offset = search_start;
|
||||
key.type = BTRFS_DEV_EXTENT_KEY;
|
||||
|
||||
ret = btrfs_search_slot(trans, root, &key, path, 0, 0);
|
||||
ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);
|
||||
if (ret < 0)
|
||||
goto out;
|
||||
if (ret > 0) {
|
||||
@ -1469,8 +1467,7 @@ int btrfs_rm_device(struct btrfs_root *root, char *device_path)
|
||||
/*
|
||||
* does all the dirty work required for changing file system's UUID.
|
||||
*/
|
||||
static int btrfs_prepare_sprout(struct btrfs_trans_handle *trans,
|
||||
struct btrfs_root *root)
|
||||
static int btrfs_prepare_sprout(struct btrfs_root *root)
|
||||
{
|
||||
struct btrfs_fs_devices *fs_devices = root->fs_info->fs_devices;
|
||||
struct btrfs_fs_devices *old_devices;
|
||||
@ -1695,7 +1692,7 @@ int btrfs_init_new_device(struct btrfs_root *root, char *device_path)
|
||||
|
||||
if (seeding_dev) {
|
||||
sb->s_flags &= ~MS_RDONLY;
|
||||
ret = btrfs_prepare_sprout(trans, root);
|
||||
ret = btrfs_prepare_sprout(root);
|
||||
BUG_ON(ret);
|
||||
}
|
||||
|
||||
@ -2323,8 +2320,7 @@ int btrfs_shrink_device(struct btrfs_device *device, u64 new_size)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int btrfs_add_system_chunk(struct btrfs_trans_handle *trans,
|
||||
struct btrfs_root *root,
|
||||
static int btrfs_add_system_chunk(struct btrfs_root *root,
|
||||
struct btrfs_key *key,
|
||||
struct btrfs_chunk *chunk, int item_size)
|
||||
{
|
||||
@ -2496,7 +2492,7 @@ static int __btrfs_alloc_chunk(struct btrfs_trans_handle *trans,
|
||||
if (total_avail == 0)
|
||||
continue;
|
||||
|
||||
ret = find_free_dev_extent(trans, device,
|
||||
ret = find_free_dev_extent(device,
|
||||
max_stripe_size * dev_stripes,
|
||||
&dev_offset, &max_avail);
|
||||
if (ret && ret != -ENOSPC)
|
||||
@ -2687,7 +2683,7 @@ static int __finish_chunk_alloc(struct btrfs_trans_handle *trans,
|
||||
BUG_ON(ret);
|
||||
|
||||
if (map->type & BTRFS_BLOCK_GROUP_SYSTEM) {
|
||||
ret = btrfs_add_system_chunk(trans, chunk_root, &key, chunk,
|
||||
ret = btrfs_add_system_chunk(chunk_root, &key, chunk,
|
||||
item_size);
|
||||
BUG_ON(ret);
|
||||
}
|
||||
|
@ -230,7 +230,6 @@ int btrfs_shrink_device(struct btrfs_device *device, u64 new_size);
|
||||
int btrfs_init_new_device(struct btrfs_root *root, char *path);
|
||||
int btrfs_balance(struct btrfs_root *dev_root);
|
||||
int btrfs_chunk_readonly(struct btrfs_root *root, u64 chunk_offset);
|
||||
int find_free_dev_extent(struct btrfs_trans_handle *trans,
|
||||
struct btrfs_device *device, u64 num_bytes,
|
||||
int find_free_dev_extent(struct btrfs_device *device, u64 num_bytes,
|
||||
u64 *start, u64 *max_avail);
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user