@@ -45,6 +45,8 @@ static int print_replace_status(int fd, const char *path, int once);
static char *time2string(char *buf, size_t s, __u64 t);
static char *progress2string(char *buf, size_t s, int progress_1000);
+/* Used to separate internal errors from actual dev replace ioctl results. */
+#define BTRFS_IOCTL_DEV_REPLACE_RESULT_NO_RESULT -1
static const char *replace_dev_result2string(__u64 result)
{
@@ -192,7 +192,6 @@ BUILD_ASSERT(sizeof(struct btrfs_ioctl_dev_replace_status_params) == 48);
#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
BTRFS_IOCTL_DEV_REPLACE_RESULT_NO_RESULT is defined to make sure we differentiate internal errors from actual error codes that come back from the device replace ioctl. Take this out of ioctl.c and move it into replace.c. Signed-off-by: Josef Bacik <josef@toxicpanda.com> --- cmds/replace.c | 2 ++ ioctl.h | 1 - 2 files changed, 2 insertions(+), 1 deletion(-)