Commit e9b919b1 authored by Nikolay Borisov's avatar Nikolay Borisov Committed by David Sterba

btrfs: Remove fs_info argument from btrfs_update_commit_device_bytes_used

We already pass the btrfs_transaction which references fs_info so no
need to pass the later as an argument. Also use the opportunity to
shorten transaction->trans. No functional changes.
Signed-off-by: default avatarNikolay Borisov <nborisov@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 08d50ca3
...@@ -2246,7 +2246,7 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans) ...@@ -2246,7 +2246,7 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans)
sizeof(*fs_info->super_copy)); sizeof(*fs_info->super_copy));
btrfs_update_commit_device_size(fs_info); btrfs_update_commit_device_size(fs_info);
btrfs_update_commit_device_bytes_used(fs_info, cur_trans); btrfs_update_commit_device_bytes_used(cur_trans);
clear_bit(BTRFS_FS_LOG1_ERR, &fs_info->flags); clear_bit(BTRFS_FS_LOG1_ERR, &fs_info->flags);
clear_bit(BTRFS_FS_LOG2_ERR, &fs_info->flags); clear_bit(BTRFS_FS_LOG2_ERR, &fs_info->flags);
......
...@@ -7345,20 +7345,20 @@ void btrfs_update_commit_device_size(struct btrfs_fs_info *fs_info) ...@@ -7345,20 +7345,20 @@ void btrfs_update_commit_device_size(struct btrfs_fs_info *fs_info)
} }
/* Must be invoked during the transaction commit */ /* Must be invoked during the transaction commit */
void btrfs_update_commit_device_bytes_used(struct btrfs_fs_info *fs_info, void btrfs_update_commit_device_bytes_used(struct btrfs_transaction *trans)
struct btrfs_transaction *transaction)
{ {
struct btrfs_fs_info *fs_info = trans->fs_info;
struct extent_map *em; struct extent_map *em;
struct map_lookup *map; struct map_lookup *map;
struct btrfs_device *dev; struct btrfs_device *dev;
int i; int i;
if (list_empty(&transaction->pending_chunks)) if (list_empty(&trans->pending_chunks))
return; return;
/* In order to kick the device replace finish process */ /* In order to kick the device replace finish process */
mutex_lock(&fs_info->chunk_mutex); mutex_lock(&fs_info->chunk_mutex);
list_for_each_entry(em, &transaction->pending_chunks, list) { list_for_each_entry(em, &trans->pending_chunks, list) {
map = em->map_lookup; map = em->map_lookup;
for (i = 0; i < map->num_stripes; i++) { for (i = 0; i < map->num_stripes; i++) {
......
...@@ -545,8 +545,7 @@ static inline void btrfs_dev_stat_reset(struct btrfs_device *dev, ...@@ -545,8 +545,7 @@ static inline void btrfs_dev_stat_reset(struct btrfs_device *dev,
} }
void btrfs_update_commit_device_size(struct btrfs_fs_info *fs_info); void btrfs_update_commit_device_size(struct btrfs_fs_info *fs_info);
void btrfs_update_commit_device_bytes_used(struct btrfs_fs_info *fs_info, void btrfs_update_commit_device_bytes_used(struct btrfs_transaction *trans);
struct btrfs_transaction *transaction);
struct list_head *btrfs_get_fs_uuids(void); struct list_head *btrfs_get_fs_uuids(void);
void btrfs_set_fs_info_ptr(struct btrfs_fs_info *fs_info); void btrfs_set_fs_info_ptr(struct btrfs_fs_info *fs_info);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment