The error code is in errno, not the return value.
Signed-off-by: Thomas Bertschinger <tahbertschinger@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Add an environment variable that indicates we prefer to run bcachefs
code in the kernel, not userspace - this is for the test environment
where it's easier to debug kernel code.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
We need to check when stdin has been closed - otherwise we'll spin
because select() will return immediately.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
To avoid expensive version upgrades and downgrades - use the kernel
version of fsck when it's availale and a better match.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This moves the Rust sources out of rust_src/ and into the top level.
Running the bcachefs executable out of the development tree is now:
$ ./target/release/bcachefs command
or
$ cargo run --profile release -- command
instead of "./bcachefs command".
Building and installing is still:
$ make && make install
Signed-off-by: Thomas Bertschinger <tahbertschinger@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>