btrfs: merge two superblock writing helpers
authorDavid Sterba <dsterba@suse.com>
Fri, 10 Feb 2017 18:04:32 +0000 (19:04 +0100)
committerDavid Sterba <dsterba@suse.com>
Fri, 17 Feb 2017 11:03:51 +0000 (12:03 +0100)
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 <bo.li.liu@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/disk-io.c
fs/btrfs/disk-io.h
fs/btrfs/transaction.c
fs/btrfs/tree-log.c

index 43e71457c193e62433b1c3168e7c8be64a6f5867..441a62cd035173db7f44c0cb1de4a1fe3539c251 100644 (file)
@@ -3695,7 +3695,7 @@ int btrfs_calc_num_tolerated_disk_barrier_failures(
        return num_tolerated_disk_barrier_failures;
 }
 
-static int write_all_supers(struct btrfs_fs_info *fs_info, int max_mirrors)
+int write_all_supers(struct btrfs_fs_info *fs_info, int max_mirrors)
 {
        struct list_head *head;
        struct btrfs_device *dev;
@@ -3789,12 +3789,6 @@ static int write_all_supers(struct btrfs_fs_info *fs_info, int max_mirrors)
        return 0;
 }
 
-int write_ctree_super(struct btrfs_trans_handle *trans,
-                     struct btrfs_fs_info *fs_info, int max_mirrors)
-{
-       return write_all_supers(fs_info, max_mirrors);
-}
-
 /* Drop a fs root from the radix tree and free it. */
 void btrfs_drop_and_free_fs_root(struct btrfs_fs_info *fs_info,
                                  struct btrfs_root *root)
index 1864e7ce9c704c6cd8f3feeeae9ef5062b2cf698..0be2d4fe705b4d563cb33134ea769d51c88aedbd 100644 (file)
@@ -57,8 +57,7 @@ int open_ctree(struct super_block *sb,
               struct btrfs_fs_devices *fs_devices,
               char *options);
 void close_ctree(struct btrfs_fs_info *fs_info);
-int write_ctree_super(struct btrfs_trans_handle *trans,
-                     struct btrfs_fs_info *fs_info, int max_mirrors);
+int write_all_supers(struct btrfs_fs_info *fs_info, int max_mirrors);
 struct buffer_head *btrfs_read_dev_super(struct block_device *bdev);
 int btrfs_read_dev_one_super(struct block_device *bdev, int copy_num,
                        struct buffer_head **bh_ret);
index 5eefd77bafc779ace09f357fbab7a3bc18bad814..c27f2223209338fe8c3d9e9002493651d10385c5 100644 (file)
@@ -2257,7 +2257,7 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans)
                goto scrub_continue;
        }
 
-       ret = write_ctree_super(trans, fs_info, 0);
+       ret = write_all_supers(fs_info, 0);
        if (ret) {
                mutex_unlock(&fs_info->tree_log_mutex);
                goto scrub_continue;
index cea93ba1f0990731765975b8376f63c3aee3d71f..62dd138018b57ce6040bda5eb59a748b294eff21 100644 (file)
@@ -2961,7 +2961,7 @@ int btrfs_sync_log(struct btrfs_trans_handle *trans,
         * the running transaction open, so a full commit can't hop
         * in and cause problems either.
         */
-       ret = write_ctree_super(trans, fs_info, 1);
+       ret = write_all_supers(fs_info, 1);
        if (ret) {
                btrfs_set_log_full_commit(fs_info, trans);
                btrfs_abort_transaction(trans, ret);