]> git.sesse.net Git - bcachefs-tools-debian/commitdiff
A small compile fix
authorMikulas Patocka <mpatocka@redhat.com>
Wed, 26 Apr 2023 12:31:10 +0000 (08:31 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Wed, 26 Apr 2023 14:44:49 +0000 (10:44 -0400)
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>
include/linux/bit_spinlock.h

index ed47cc6371782924b162c6f8eec56dafb48abe08..62b91afaf9e0bb275f6cf5666ac53f77937a7a7d 100644 (file)
@@ -4,6 +4,7 @@
 #include <linux/kernel.h>
 #include <linux/preempt.h>
 #include <linux/futex.h>
+#include <urcu/futex.h>
 
 static inline void bit_spin_lock(int nr, unsigned long *_addr)
 {