bcachefs-tools/cmd_run.c
Austin Seipp 997bb216aa build: require explicit include paths for libbcachefs/
This removes the implicit `-I libbcachefs` argument to $(CC), which in turn
requires a set of minor changes throughout the tools. There are two advantages
to this setup:

    1) It is (arguably) easier to read, since the location of bcachefs includes
    are easier to understand at a glance ("where does util.h live?")

    2) It removes the need for a hack to include glibc's copy of
    dirent.h explicitly via '/usr/include/dirent.h', because libbcachefs/
    *also* has a dirent.h file and the compiler cannot disambiguate them.
    This has some ramifications on systems where /usr/include may not
    exist, such as NixOS.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
2017-12-10 16:06:01 -06:00

31 lines
495 B
C

#include <errno.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <unistd.h>
#include <uuid/uuid.h>
#include "libbcachefs/bcachefs_ioctl.h"
#include "cmds.h"
int cmd_run(int argc, char *argv[])
{
return 0;
}
int cmd_stop(int argc, char *argv[])
{
if (argc != 2)
die("Please supply a filesystem");
struct bcache_handle fs = bcache_fs_open(argv[1]);
xioctl(fs.ioctl_fd, BCH_IOCTL_STOP);
return 0;
}