btrfs-progs: tests: Add test for super block recovery
[platform/upstream/btrfs-progs.git] / cmds-replace.c
index 6036e2f..a3ea977 100644 (file)
@@ -37,7 +37,8 @@
 #include "disk-io.h"
 
 #include "commands.h"
-
+#include "help.h"
+#include "mkfs/common.h"
 
 static int print_replace_status(int fd, const char *path, int once);
 static char *time2string(char *buf, size_t s, __u64 t);
@@ -254,8 +255,8 @@ static int cmd_replace_start(int argc, char **argv)
        }
        strncpy((char *)start_args.start.tgtdev_name, dstdev,
                BTRFS_DEVICE_PATH_NAME_MAX);
-       ret = btrfs_prepare_device(fddstdev, dstdev, 1, &dstdev_block_count, 0,
-                               0);
+       ret = btrfs_prepare_device(fddstdev, dstdev, &dstdev_block_count, 0,
+                       PREP_DEVICE_ZERO_END | PREP_DEVICE_VERBOSE);
        if (ret)
                goto leave_with_error;
 
@@ -436,7 +437,7 @@ static int print_replace_status(int fd, const char *path, int once)
                        printf("Never started");
                        break;
                default:
-                       error("unknown status from ioctl DEV_REPLACE_STATUS on '%s': %llu\n",
+                       error("unknown status from ioctl DEV_REPLACE_STATUS on '%s': %llu",
                                        path, status->replace_state);
                        return -EINVAL;
                }