diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 666fd54928e8..cc8967269488 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -4033,8 +4033,9 @@ int btrfs_get_num_tolerated_disk_barrier_failures(u64 flags) return min_tolerated; } -int write_all_supers(struct btrfs_fs_info *fs_info, int max_mirrors) +int write_all_supers(struct btrfs_trans_handle *trans, int max_mirrors) { + struct btrfs_fs_info *fs_info = trans->fs_info; struct list_head *head; struct btrfs_device *dev; struct btrfs_super_block *sb; diff --git a/fs/btrfs/disk-io.h b/fs/btrfs/disk-io.h index 5320da83d0cf..081a6860861c 100644 --- a/fs/btrfs/disk-io.h +++ b/fs/btrfs/disk-io.h @@ -58,7 +58,7 @@ void __cold close_ctree(struct btrfs_fs_info *fs_info); int btrfs_validate_super(const struct btrfs_fs_info *fs_info, const struct btrfs_super_block *sb, int mirror_num); int btrfs_check_features(struct btrfs_fs_info *fs_info, bool is_rw_mount); -int write_all_supers(struct btrfs_fs_info *fs_info, int max_mirrors); +int write_all_supers(struct btrfs_trans_handle *trans, int max_mirrors); int btrfs_commit_super(struct btrfs_fs_info *fs_info); struct btrfs_root *btrfs_read_tree_root(struct btrfs_root *tree_root, const struct btrfs_key *key); diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index 8dd77c431974..8f24a025625e 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c @@ -2573,7 +2573,7 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans) goto scrub_continue; } - ret = write_all_supers(fs_info, 0); + ret = write_all_supers(trans, 0); /* * the super is written, we can safely allow the tree-loggers * to go about their business diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index ac871efb9763..4f360ccf8380 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c @@ -3576,7 +3576,7 @@ int btrfs_sync_log(struct btrfs_trans_handle *trans, btrfs_set_super_log_root(fs_info->super_for_commit, log_root_start); btrfs_set_super_log_root_level(fs_info->super_for_commit, log_root_level); - ret = write_all_supers(fs_info, 1); + ret = write_all_supers(trans, 1); mutex_unlock(&fs_info->tree_log_mutex); if (unlikely(ret)) { btrfs_set_log_full_commit(trans);