Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

bcachefs: Fixes for rust bindgen

bindgen doesn't seem to like u128 or DECLARE_FLEX_ARRAY(), but we can
hack around them.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>

+8 -1
+4 -1
fs/bcachefs/mean_and_variance.h
··· 12 12 /* 13 13 * u128_u: u128 user mode, because not all architectures support a real int128 14 14 * type 15 + * 16 + * We don't use this version in userspace, because in userspace we link with 17 + * Rust and rustc has issues with u128. 15 18 */ 16 19 17 - #ifdef __SIZEOF_INT128__ 20 + #if defined(__SIZEOF_INT128__) && defined(__KERNEL__) 18 21 19 22 typedef struct { 20 23 unsigned __int128 v;
+4
fs/bcachefs/subvolume_types.h
··· 20 20 }; 21 21 22 22 struct snapshot_table { 23 + #ifndef RUST_BINDGEN 23 24 DECLARE_FLEX_ARRAY(struct snapshot_t, s); 25 + #else 26 + struct snapshot_t s[0]; 27 + #endif 24 28 }; 25 29 26 30 typedef struct {