2015-05-09 04:13:38 +03:00
|
|
|
|
|
|
|
#include <alloca.h>
|
|
|
|
#include <errno.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <sys/ioctl.h>
|
|
|
|
|
2017-11-27 04:29:00 +03:00
|
|
|
#include "libbcachefs/bcachefs_ioctl.h"
|
2017-02-02 06:16:42 +03:00
|
|
|
#include "cmds.h"
|
2017-12-28 09:01:16 +03:00
|
|
|
#include "libbcachefs.h"
|
2015-05-09 04:13:38 +03:00
|
|
|
|
2018-05-17 08:38:57 +03:00
|
|
|
#if 0
|
2016-08-24 06:50:31 +03:00
|
|
|
int cmd_assemble(int argc, char *argv[])
|
2015-05-09 04:13:38 +03:00
|
|
|
{
|
2016-08-24 06:50:31 +03:00
|
|
|
unsigned nr_devs = argc - 1;
|
|
|
|
|
|
|
|
if (argc <= 1)
|
|
|
|
die("Please supply at least one device");
|
2015-05-09 04:13:38 +03:00
|
|
|
|
|
|
|
struct bch_ioctl_assemble *assemble =
|
|
|
|
alloca(sizeof(*assemble) + sizeof(__u64) * nr_devs);
|
|
|
|
|
|
|
|
memset(assemble, 0, sizeof(*assemble));
|
|
|
|
assemble->nr_devs = nr_devs;
|
|
|
|
|
2017-08-18 00:11:06 +03:00
|
|
|
unsigned i;
|
2018-03-14 02:52:23 +03:00
|
|
|
for (i = 0; i < nr_devs; i++)
|
2018-05-17 08:38:57 +03:00
|
|
|
assemble->devs[i] = (unsigned long) argv[i + 1];
|
2015-05-09 04:13:38 +03:00
|
|
|
|
2017-04-15 07:40:50 +03:00
|
|
|
xioctl(bcachectl_open(), BCH_IOCTL_ASSEMBLE, assemble);
|
2015-05-09 04:13:38 +03:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2016-08-24 06:50:31 +03:00
|
|
|
int cmd_incremental(int argc, char *argv[])
|
2015-05-09 04:13:38 +03:00
|
|
|
{
|
2016-08-24 06:50:31 +03:00
|
|
|
if (argc != 2)
|
2015-05-09 04:13:38 +03:00
|
|
|
die("Please supply exactly one device");
|
|
|
|
|
|
|
|
struct bch_ioctl_incremental incremental = {
|
2018-05-17 08:38:57 +03:00
|
|
|
.dev = (unsigned long) argv[1],
|
2015-05-09 04:13:38 +03:00
|
|
|
};
|
|
|
|
|
2017-04-15 07:40:50 +03:00
|
|
|
xioctl(bcachectl_open(), BCH_IOCTL_INCREMENTAL, &incremental);
|
2015-05-09 04:13:38 +03:00
|
|
|
return 0;
|
|
|
|
}
|
2018-05-17 08:38:57 +03:00
|
|
|
#endif
|