After upgrading liburcu to v0.15.0, bcachefs-tools failed to build. This patch
fixes build errors on liburcu v0.15.0.
Signed-off-by: Integral <integral@archlinuxcn.org>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This resolves build warnings and failures for architectures where the
Linux userspace `asm/types.h` header defines 64-bit types (u64, s64) as
`long` instead of `long long`.
By defining `__SANE_USERSPACE_TYPES__`, these types are defined as
`long long` instead.
Signed-off-by: Thomas Bertschinger <tahbertschinger@gmail.com>
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>
this gets us back down to a single fd for opening block devices, which
means we can use O_EXCL.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
not needed with pwritev2(.., RWF_SYNC), and perhaps we can get down to
one fd and then use O_EXCL for block devices.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Our include/linux/byteorder.h uses the system <asm/byteorder.h>
because we don't provide our own in include/asm. This then pulls in
system <linux/stddef.h> which defines __struct_group. That definition
collides with the unconditional #define __struct_group in our local
include/linux/kernel.h, provoking preprocessor warnings.
Signed-off-by: Chris Webb <chris@arachsys.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Use a single sysinfo(2) call to fill out struct sysinfo instead of
multiple libc sysconf(3) requests, which will only make sysinfo(2) calls
internally anyway. This also enables us to access other struct sysinfo
fields, not just the three filled-out previously.
As we provide our own definition of struct sysinfo in include/linux/mm.h
to match the kernel, which is not guaranteed to align with the definition
libc provides in <sys/sysinfo.h>, use syscall(SYS_sysinfo, ...) directly
instead of the libc wrapper.
Signed-off-by: Chris Webb <chris@arachsys.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
prior to this patch, on certain platforms (ie: armv7l), compilation fails due
to atomic64_sub_return_release not being defined here. Ensure that the atomics
header is pulled in, and ensure that it is available in all cases, regardless
of whether ATOMIC64_SPINLOCK is defined.
Signed-off-by: Nicholas Sielicki <linux@opensource.nslick.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
size_t is apparently not an unsigned long on 32 bit, which is what
rounddown_pow_of_two() returns.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>