Skip to content

Commit

Permalink
btrfs: remove fs_info parameter from btrfs_cleanup_one_transaction()
Browse files Browse the repository at this point in the history
The fs_info parameter is redundant because it can be extracted from the
transaction given as another parameter. So remove it and use the fs_info
accessible from the transaction.

Reviewed-by: Boris Burkov <boris@bur.io>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
  • Loading branch information
fdmanana authored and kdave committed Nov 11, 2024
1 parent 2f6e05a commit c3a5888
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
8 changes: 4 additions & 4 deletions fs/btrfs/disk-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -4183,7 +4183,7 @@ static void warn_about_uncommitted_trans(struct btrfs_fs_info *fs_info)
btrfs_warn(fs_info,
"transaction %llu (with %llu dirty metadata bytes) is not committed",
trans->transid, dirty_bytes);
btrfs_cleanup_one_transaction(trans, fs_info);
btrfs_cleanup_one_transaction(trans);

if (trans == fs_info->running_transaction)
fs_info->running_transaction = NULL;
Expand Down Expand Up @@ -4734,9 +4734,9 @@ static void btrfs_free_all_qgroup_pertrans(struct btrfs_fs_info *fs_info)
spin_unlock(&fs_info->fs_roots_radix_lock);
}

void btrfs_cleanup_one_transaction(struct btrfs_transaction *cur_trans,
struct btrfs_fs_info *fs_info)
void btrfs_cleanup_one_transaction(struct btrfs_transaction *cur_trans)
{
struct btrfs_fs_info *fs_info = cur_trans->fs_info;
struct btrfs_device *dev, *tmp;

btrfs_cleanup_dirty_bgs(cur_trans, fs_info);
Expand Down Expand Up @@ -4794,7 +4794,7 @@ static int btrfs_cleanup_transaction(struct btrfs_fs_info *fs_info)
} else {
spin_unlock(&fs_info->trans_lock);
}
btrfs_cleanup_one_transaction(t, fs_info);
btrfs_cleanup_one_transaction(t);

spin_lock(&fs_info->trans_lock);
if (t == fs_info->running_transaction)
Expand Down
3 changes: 1 addition & 2 deletions fs/btrfs/disk-io.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,7 @@ int btrfs_add_log_tree(struct btrfs_trans_handle *trans,
struct btrfs_root *root);
void btrfs_cleanup_dirty_bgs(struct btrfs_transaction *trans,
struct btrfs_fs_info *fs_info);
void btrfs_cleanup_one_transaction(struct btrfs_transaction *trans,
struct btrfs_fs_info *fs_info);
void btrfs_cleanup_one_transaction(struct btrfs_transaction *trans);
struct btrfs_root *btrfs_create_tree(struct btrfs_trans_handle *trans,
u64 objectid);
int btrfs_get_num_tolerated_disk_barrier_failures(u64 flags);
Expand Down
2 changes: 1 addition & 1 deletion fs/btrfs/transaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -2052,7 +2052,7 @@ static void cleanup_transaction(struct btrfs_trans_handle *trans, int err)

spin_unlock(&fs_info->trans_lock);

btrfs_cleanup_one_transaction(trans->transaction, fs_info);
btrfs_cleanup_one_transaction(trans->transaction);

spin_lock(&fs_info->trans_lock);
if (cur_trans == fs_info->running_transaction)
Expand Down

0 comments on commit c3a5888

Please sign in to comment.