]> git.sesse.net Git - bcachefs-tools-debian/blob - bcache-run.c
finish ripping out libnih
[bcachefs-tools-debian] / bcache-run.c
1
2 #include <errno.h>
3 #include <stdbool.h>
4 #include <stdio.h>
5 #include <stdlib.h>
6 #include <string.h>
7
8 #include <fcntl.h>
9 #include <sys/ioctl.h>
10 #include <unistd.h>
11
12 #include <uuid/uuid.h>
13
14 #include "bcache.h"
15
16 int cmd_run(int argc, char *argv[])
17 {
18         return 0;
19 }
20
21 int cmd_stop(int argc, char *argv[])
22 {
23         if (argc != 2)
24                 die("Please supply a filesystem");
25
26         struct bcache_handle fs = bcache_fs_open(argv[1]);
27
28         if (ioctl(fs.fd, BCH_IOCTL_STOP))
29                 die("BCH_IOCTL_STOP error: %s", strerror(errno));
30
31         return 0;
32 }