This adds a new option to cmd_fsck for using the kernel implementation
of fsck instead of userspace, via the BCH_IOCTL_FSCK_OFFLINE ioctl.
This isn't intended for normal usage - mainly for testing and debugging
purposes, and for when the kernel version of bcachefs better matches the
on disk format version.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This hooks up cmd_fsck to the new BCH_IOCTL_FSCK_ONLINE: if a filesystem
is mounted, we now use that instead of bailing out with an error.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This adds a new list mode to "bcachefs list", for printing out nodes as
they exist on disk (before being merge sorted). Also some improvements
to fsck return values.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
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>