diff mbox

btrfs-progs: add new dev replace result

Message ID 1413175333-26095-2-git-send-email-guaneryu@gmail.com (mailing list archive)
State Accepted
Headers show

Commit Message

Eryu Guan Oct. 13, 2014, 4:42 a.m. UTC
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>
---
 cmds-replace.c | 2 ++
 ioctl.h        | 1 +
 2 files changed, 3 insertions(+)
diff mbox

Patch

diff --git a/cmds-replace.c b/cmds-replace.c
index 9fe7ad8..7a45cef 100644
--- a/cmds-replace.c
+++ b/cmds-replace.c
@@ -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 f0fc060..0e02fae 100644
--- a/ioctl.h
+++ b/ioctl.h
@@ -144,6 +144,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 */