Commit 00251a52 authored by David Sterba's avatar David Sterba

btrfs: squeeze btrfs_dev_replace_continue_on_mount to its caller

The function is called once and is fairly small, we can merge it with
the caller.
Reviewed-by: default avatarAnand Jain <anand.jain@oracle.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent b5185197
...@@ -33,8 +33,6 @@ static void btrfs_dev_replace_update_device_in_mapping_tree( ...@@ -33,8 +33,6 @@ static void btrfs_dev_replace_update_device_in_mapping_tree(
struct btrfs_device *srcdev, struct btrfs_device *srcdev,
struct btrfs_device *tgtdev); struct btrfs_device *tgtdev);
static int btrfs_dev_replace_kthread(void *data); static int btrfs_dev_replace_kthread(void *data);
static int btrfs_dev_replace_continue_on_mount(struct btrfs_fs_info *fs_info);
int btrfs_init_dev_replace(struct btrfs_fs_info *fs_info) int btrfs_init_dev_replace(struct btrfs_fs_info *fs_info)
{ {
...@@ -810,6 +808,7 @@ static int btrfs_dev_replace_kthread(void *data) ...@@ -810,6 +808,7 @@ static int btrfs_dev_replace_kthread(void *data)
struct btrfs_fs_info *fs_info = data; struct btrfs_fs_info *fs_info = data;
struct btrfs_dev_replace *dev_replace = &fs_info->dev_replace; struct btrfs_dev_replace *dev_replace = &fs_info->dev_replace;
u64 progress; u64 progress;
int ret;
progress = btrfs_dev_replace_progress(fs_info); progress = btrfs_dev_replace_progress(fs_info);
progress = div_u64(progress, 10); progress = div_u64(progress, 10);
...@@ -820,23 +819,14 @@ static int btrfs_dev_replace_kthread(void *data) ...@@ -820,23 +819,14 @@ static int btrfs_dev_replace_kthread(void *data)
btrfs_dev_name(dev_replace->tgtdev), btrfs_dev_name(dev_replace->tgtdev),
(unsigned int)progress); (unsigned int)progress);
btrfs_dev_replace_continue_on_mount(fs_info);
clear_bit(BTRFS_FS_EXCL_OP, &fs_info->flags);
return 0;
}
static int btrfs_dev_replace_continue_on_mount(struct btrfs_fs_info *fs_info)
{
struct btrfs_dev_replace *dev_replace = &fs_info->dev_replace;
int ret;
ret = btrfs_scrub_dev(fs_info, dev_replace->srcdev->devid, ret = btrfs_scrub_dev(fs_info, dev_replace->srcdev->devid,
dev_replace->committed_cursor_left, dev_replace->committed_cursor_left,
btrfs_device_get_total_bytes(dev_replace->srcdev), btrfs_device_get_total_bytes(dev_replace->srcdev),
&dev_replace->scrub_progress, 0, 1); &dev_replace->scrub_progress, 0, 1);
ret = btrfs_dev_replace_finishing(fs_info, ret); ret = btrfs_dev_replace_finishing(fs_info, ret);
WARN_ON(ret); WARN_ON(ret);
clear_bit(BTRFS_FS_EXCL_OP, &fs_info->flags);
return 0; return 0;
} }
......
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