btrfs-progs: add new dev replace result
authorEryu Guan <guaneryu@gmail.com>
Mon, 13 Oct 2014 04:42:13 +0000 (12:42 +0800)
committerDavid Sterba <dsterba@suse.cz>
Tue, 25 Nov 2014 17:50:58 +0000 (18:50 +0100)
A new dev replace result was introduced by kernel commit

Btrfs: return failure if btrfs_dev_replace_finishing() failed

Make the userspace know about the new result too.

Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
cmds-replace.c
ioctl.h

index f7cb0b2..63d34f9 100644 (file)
@@ -53,6 +53,8 @@ static const char *replace_dev_result2string(__u64 result)
                return "not started";
        case BTRFS_IOCTL_DEV_REPLACE_RESULT_ALREADY_STARTED:
                return "already started";
+       case BTRFS_IOCTL_DEV_REPLACE_RESULT_SCRUB_INPROGRESS:
+               return "scrub is in progress";
        default:
                return "<illegal result value>";
        }
diff --git a/ioctl.h b/ioctl.h
index df9e4b7..67c8de9 100644 (file)
--- a/ioctl.h
+++ b/ioctl.h
@@ -145,6 +145,7 @@ struct btrfs_ioctl_dev_replace_status_params {
 #define BTRFS_IOCTL_DEV_REPLACE_RESULT_NO_ERROR                        0
 #define BTRFS_IOCTL_DEV_REPLACE_RESULT_NOT_STARTED             1
 #define BTRFS_IOCTL_DEV_REPLACE_RESULT_ALREADY_STARTED         2
+#define BTRFS_IOCTL_DEV_REPLACE_RESULT_SCRUB_INPROGRESS                3
 struct btrfs_ioctl_dev_replace_args {
        __u64 cmd;      /* in */
        __u64 result;   /* out */