btrfs-progs: add new dev replace result
[platform/upstream/btrfs-progs.git] / ioctl.h
diff --git a/ioctl.h b/ioctl.h
index 7f7e1d6..67c8de9 100644 (file)
--- a/ioctl.h
+++ b/ioctl.h
@@ -141,9 +141,11 @@ struct btrfs_ioctl_dev_replace_status_params {
 #define BTRFS_IOCTL_DEV_REPLACE_CMD_START                      0
 #define BTRFS_IOCTL_DEV_REPLACE_CMD_STATUS                     1
 #define BTRFS_IOCTL_DEV_REPLACE_CMD_CANCEL                     2
+#define BTRFS_IOCTL_DEV_REPLACE_RESULT_NO_RESULT               -1
 #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 */
@@ -194,7 +196,9 @@ struct btrfs_balance_args {
 
        __u64 flags;
 
-       __u64 unused[8];
+       __u64 limit;
+
+       __u64 unused[7];
 } __attribute__ ((__packed__));
 
 struct btrfs_balance_progress {
@@ -480,9 +484,9 @@ static inline char *btrfs_err_str(enum btrfs_err_code err_code)
                case BTRFS_ERROR_DEV_RAID10_MIN_NOT_MET:
                        return "unable to go below four devices on raid10";
                case BTRFS_ERROR_DEV_RAID5_MIN_NOT_MET:
-                       return "unable to go below three devices on raid5";
+                       return "unable to go below two devices on raid5";
                case BTRFS_ERROR_DEV_RAID6_MIN_NOT_MET:
-                       return "unable to go below four devices on raid6";
+                       return "unable to go below three devices on raid6";
                case BTRFS_ERROR_DEV_TGT_REPLACE:
                        return "unable to remove the dev_replace target dev";
                case BTRFS_ERROR_DEV_MISSING_NOT_FOUND:
@@ -540,7 +544,7 @@ struct btrfs_ioctl_clone_range_args {
                                   struct btrfs_ioctl_search_args)
 #define BTRFS_IOC_INO_LOOKUP _IOWR(BTRFS_IOCTL_MAGIC, 18, \
                                   struct btrfs_ioctl_ino_lookup_args)
-#define BTRFS_IOC_DEFAULT_SUBVOL _IOW(BTRFS_IOCTL_MAGIC, 19, u64)
+#define BTRFS_IOC_DEFAULT_SUBVOL _IOW(BTRFS_IOCTL_MAGIC, 19, __u64)
 #define BTRFS_IOC_SPACE_INFO _IOWR(BTRFS_IOCTL_MAGIC, 20, \
                                    struct btrfs_ioctl_space_args)
 #define BTRFS_IOC_START_SYNC _IOR(BTRFS_IOCTL_MAGIC, 24, __u64)