btrfs: open code btrfs_dev_replace_cancel()
authorAnand Jain <anand.jain@oracle.com>
Mon, 12 Feb 2018 15:33:29 +0000 (23:33 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 26 Mar 2018 13:09:29 +0000 (15:09 +0200)
btrfs_dev_replace_cancel() calls __btrfs_dev_replace_cancel() for the
actual cancel so just open code it.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/dev-replace.c
fs/btrfs/dev-replace.h
fs/btrfs/ioctl.c

index 7efbc4d1128b222f0d18c18998b0f955debc2ac9..1ce9528663a6512d8583c047695c97052591d8b7 100644 (file)
@@ -44,7 +44,6 @@ static void btrfs_dev_replace_update_device_in_mapping_tree(
                                                struct btrfs_fs_info *fs_info,
                                                struct btrfs_device *srcdev,
                                                struct btrfs_device *tgtdev);
-static u64 __btrfs_dev_replace_cancel(struct btrfs_fs_info *fs_info);
 static int btrfs_dev_replace_kthread(void *data);
 static int btrfs_dev_replace_continue_on_mount(struct btrfs_fs_info *fs_info);
 
@@ -694,14 +693,7 @@ void btrfs_dev_replace_status(struct btrfs_fs_info *fs_info,
        btrfs_dev_replace_unlock(dev_replace, 0);
 }
 
-int btrfs_dev_replace_cancel(struct btrfs_fs_info *fs_info,
-                            struct btrfs_ioctl_dev_replace_args *args)
-{
-       args->result = __btrfs_dev_replace_cancel(fs_info);
-       return 0;
-}
-
-static u64 __btrfs_dev_replace_cancel(struct btrfs_fs_info *fs_info)
+u64 __btrfs_dev_replace_cancel(struct btrfs_fs_info *fs_info)
 {
        struct btrfs_dev_replace *dev_replace = &fs_info->dev_replace;
        struct btrfs_device *tgt_device = NULL;
index f94a76844ae7425a3702f36013b4b415a02457c2..d8b314ff12c11f293519fd3ea1fbdf0b41ccd9fd 100644 (file)
@@ -32,8 +32,7 @@ int btrfs_dev_replace_start(struct btrfs_fs_info *fs_info,
                int read_src);
 void btrfs_dev_replace_status(struct btrfs_fs_info *fs_info,
                              struct btrfs_ioctl_dev_replace_args *args);
-int btrfs_dev_replace_cancel(struct btrfs_fs_info *fs_info,
-                            struct btrfs_ioctl_dev_replace_args *args);
+u64 __btrfs_dev_replace_cancel(struct btrfs_fs_info *fs_info);
 void btrfs_dev_replace_suspend_for_unmount(struct btrfs_fs_info *fs_info);
 int btrfs_resume_dev_replace_async(struct btrfs_fs_info *fs_info);
 int btrfs_dev_replace_is_ongoing(struct btrfs_dev_replace *dev_replace);
index 111ee282b7772a85c46dd4cf746c59cf313803cd..9082b06f8889360759dff2761cc72c73d9d7c225 100644 (file)
@@ -4429,7 +4429,8 @@ static long btrfs_ioctl_dev_replace(struct btrfs_fs_info *fs_info,
                ret = 0;
                break;
        case BTRFS_IOCTL_DEV_REPLACE_CMD_CANCEL:
-               ret = btrfs_dev_replace_cancel(fs_info, p);
+               p->result = __btrfs_dev_replace_cancel(fs_info);
+               ret = 0;
                break;
        default:
                ret = -EINVAL;