11 #include "bcache-cmds.h"
13 int cmd_assemble(int argc, char *argv[])
15 unsigned nr_devs = argc - 1;
18 die("Please supply at least one device");
20 struct bch_ioctl_assemble *assemble =
21 alloca(sizeof(*assemble) + sizeof(__u64) * nr_devs);
23 memset(assemble, 0, sizeof(*assemble));
24 assemble->nr_devs = nr_devs;
26 for (unsigned i = 1; i < argc; i++)
27 assemble->devs[i] = (__u64) argv[i];
29 int ret = ioctl(bcachectl_open(), BCH_IOCTL_ASSEMBLE, assemble);
31 die("BCH_IOCTL_ASSEMBLE error: %s", strerror(errno));
36 int cmd_incremental(int argc, char *argv[])
39 die("Please supply exactly one device");
41 struct bch_ioctl_incremental incremental = {
42 .dev = (__u64) argv[1],
45 int ret = ioctl(bcachectl_open(), BCH_IOCTL_INCREMENTAL, &incremental);
47 die("BCH_IOCTL_INCREMENTAL error: %s", strerror(errno));