Skip to content

Commit eece6a9

Browse files
committed
btrfs: merge two superblock writing helpers
write_all_supers and write_ctree_super are almost equal, the parameter 'trans' is unused so we can drop it and have just one helper. Reviewed-by: Liu Bo <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent b75f506 commit eece6a9

File tree

4 files changed

+4
-11
lines changed

4 files changed

+4
-11
lines changed

fs/btrfs/disk-io.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3695,7 +3695,7 @@ int btrfs_calc_num_tolerated_disk_barrier_failures(
36953695
return num_tolerated_disk_barrier_failures;
36963696
}
36973697

3698-
static int write_all_supers(struct btrfs_fs_info *fs_info, int max_mirrors)
3698+
int write_all_supers(struct btrfs_fs_info *fs_info, int max_mirrors)
36993699
{
37003700
struct list_head *head;
37013701
struct btrfs_device *dev;
@@ -3789,12 +3789,6 @@ static int write_all_supers(struct btrfs_fs_info *fs_info, int max_mirrors)
37893789
return 0;
37903790
}
37913791

3792-
int write_ctree_super(struct btrfs_trans_handle *trans,
3793-
struct btrfs_fs_info *fs_info, int max_mirrors)
3794-
{
3795-
return write_all_supers(fs_info, max_mirrors);
3796-
}
3797-
37983792
/* Drop a fs root from the radix tree and free it. */
37993793
void btrfs_drop_and_free_fs_root(struct btrfs_fs_info *fs_info,
38003794
struct btrfs_root *root)

fs/btrfs/disk-io.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ int open_ctree(struct super_block *sb,
5757
struct btrfs_fs_devices *fs_devices,
5858
char *options);
5959
void close_ctree(struct btrfs_fs_info *fs_info);
60-
int write_ctree_super(struct btrfs_trans_handle *trans,
61-
struct btrfs_fs_info *fs_info, int max_mirrors);
60+
int write_all_supers(struct btrfs_fs_info *fs_info, int max_mirrors);
6261
struct buffer_head *btrfs_read_dev_super(struct block_device *bdev);
6362
int btrfs_read_dev_one_super(struct block_device *bdev, int copy_num,
6463
struct buffer_head **bh_ret);

fs/btrfs/transaction.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2257,7 +2257,7 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans)
22572257
goto scrub_continue;
22582258
}
22592259

2260-
ret = write_ctree_super(trans, fs_info, 0);
2260+
ret = write_all_supers(fs_info, 0);
22612261
if (ret) {
22622262
mutex_unlock(&fs_info->tree_log_mutex);
22632263
goto scrub_continue;

fs/btrfs/tree-log.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2961,7 +2961,7 @@ int btrfs_sync_log(struct btrfs_trans_handle *trans,
29612961
* the running transaction open, so a full commit can't hop
29622962
* in and cause problems either.
29632963
*/
2964-
ret = write_ctree_super(trans, fs_info, 1);
2964+
ret = write_all_supers(fs_info, 1);
29652965
if (ret) {
29662966
btrfs_set_log_full_commit(fs_info, trans);
29672967
btrfs_abort_transaction(trans, ret);

0 commit comments

Comments
 (0)