so that libbcachefs.so builds in a reproducible way
in spite of non-deterministic filesystem readdir order.
See https://reproducible-builds.org/ for why this is good.
In an effort to rewrite `bch2_read_super` from C to Rust,
it is neccessary to have `opt_get!` macro defined, and some
FMODE_* consts (defined as macro in `include/linux/blkdev.h`)
defined as Rust const.
Bindgen is currently unable to exapnd C functional macro [1],
this this commit use the workaround as introduced in [2].
[1] https://github.com/rust-lang/rust-bindgen/issues/753
[2] https://github.com/rust-lang/rust-bindgen/issues/753#issuecomment-608546390
Signed-off-by: TruongSinh Tran-Nguyen <i@truongsinh.pro>
This commit enhances mount sub command by allowing it to accept
`OLD_BLKID_UUID=xxx` as the device, enabling whole fs mounting without relying
on colon-separated devices.
Using colon-separated devices in fstab is discouraged due to potential device
reference issues after reboot. Additionally, using `UUID=xxx` in fstab or with
`mount -t bcachefs` is currently infeasible as it depends on blkid, which prior
to v2.39, does not recognize bcachefs. This update enables mounting via fstab
using `OLD_BLKID_UUID=xxx` as obtained from `bcachefs show-super` "External
UUID".
Signed-off-by: TruongSinh Tran-Nguyen <i@truongsinh.pro>
Improve the Rust logger by adhering to idiomatic Rust conventions and
incorporating additional logging levels: warn, debug, and trace.
Signed-off-by: TruongSinh Tran-Nguyen <i@truongsinh.pro>
Hi
Here I'm sending a small compile fix for bcachefs-tools.
Without this patch, I get this error:
cargo build --release --manifest-path rust-src/Cargo.toml
Compiling bch_bindgen v0.1.0
(/usr/src/git/bcachefs-tools/rust-src/bch_bindgen)
error: failed to run custom build command for `bch_bindgen v0.1.0
(/usr/src/git/bcachefs-tools/rust-src/bch_bindgen)`
Caused by:
process didn't exit successfully:
`/usr/src/git/bcachefs-tools/rust-src/target/release/build/bch_bindgen-733e88995ce9eab7/build-script-build`
(exit status: 101)
--- stderr
warning: optimization flag '-fkeep-inline-functions' is not supported
[-Wignored-optimization-argument]
../../include/linux/bit_spinlock.h:20:3: error: call to undeclared
function 'futex'; ISO C99 and later do not support implicit function
declarations [-Wimplicit-function-declaration]
../../include/linux/bit_spinlock.h:28:2: error: call to undeclared
function 'futex'; ISO C99 and later do not support implicit function
declarations [-Wimplicit-function-declaration]
../../include/linux/bit_spinlock.h:39:2: error: call to undeclared
function 'futex'; ISO C99 and later do not support implicit function
declarations [-Wimplicit-function-declaration]
The futex() function is declared in
/usr/include/x86_64-linux-gnu/urcu/futex.h
It is not declared in linux/futex.h, so we need to include urcu/futex.h
Mikulas
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
For systems without working rust/llvm/bindgen, add an option for
building without Rust. This will be less of an option in the future, as
more code gets rewritten in Rust.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
A recent libbcachefs update accidentally committed a change that dropped
the O_DIRECT flag - we definitely didn't want to do that.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Add a new make target to build an rpm. This uses rpmbuild --build-in-place,
so no SRPM is created.
Also clean up the specfile to remove manually-added Requires: that will
be auto-generated, add a couple new BuildRequires: and use macros for
file locations.
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
- add some project info for the main readme
- migrate readmes to markdown for improved formatting
- The main binary now requires the Rust toolchain, so make note of it
in the build instructions.
Signed-off-by: Alexander Fougner <fougner89@gmail.com>
This implements BtreeNodeIter, and adds it to cmd_list.rs - the next
step in having a full replacement for cmd_list.c
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This implements opt_set!(), which works exactly the same as the C
version and allows filesystem options to be specified in Rust code.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Implement a rust equivalent to bkey_s_c, which uses references with the
correct lifetimes: now cmd_list.rs doesn't need unsafe.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This is a _very_ preliminary rewrite of the cmd_list tool in rust, which
is intended to be a testing ground for a safe interface in Rust to the
core btree interface. This adds rust wrappers for:
bch_fs: provides bch2_fs_open(), bch2_fs_stop
btree_trans: provides bch2_trans_init(), bch2_trans_exit()
btree_iter: provides peek, peek_and_restart, advance
bch_errcode: implements Display (wraps bch2_err_str())
bpos: implements Ord (wraps bpos_cmp())
bkey_s_c: implements Display (wraps bch2_bkey_val_to_text())
and other assorted types.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>