diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-02-26 21:38:12 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-02-27 21:45:42 -0500 |
commit | e0e06d95f899e5e83d66e94600928156a5eb3a4b (patch) | |
tree | 5de00419aeed9689125493ce6894ab90b5ea57a0 /rust-src/bch_bindgen/build.rs | |
parent | 30cca2e94d0dfa8c3151daf1393f402d32bb9407 (diff) |
Rust: Start of cmd_list rewrite
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>
Diffstat (limited to 'rust-src/bch_bindgen/build.rs')
-rw-r--r-- | rust-src/bch_bindgen/build.rs | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/rust-src/bch_bindgen/build.rs b/rust-src/bch_bindgen/build.rs index c5f19ff0..22c9777a 100644 --- a/rust-src/bch_bindgen/build.rs +++ b/rust-src/bch_bindgen/build.rs @@ -27,6 +27,7 @@ fn main() { .clang_arg("-DZSTD_STATIC_LINKING_ONLY") .clang_arg("-DNO_BCACHEFS_FS") .clang_arg("-D_GNU_SOURCE") + .clang_arg("-fkeep-inline-functions") .derive_debug(true) .derive_default(true) .derive_eq(true) @@ -36,11 +37,12 @@ fn main() { }) .allowlist_function(".*bch2_.*") .allowlist_function("bio_.*") - .allowlist_function("bch2_super_write_fd") .allowlist_function("derive_passphrase") .allowlist_function("request_key") .allowlist_function("add_key") .allowlist_function("keyctl_search") + .allowlist_function("match_string") + .allowlist_function("printbuf.*") .blocklist_type("bch_extent_ptr") .blocklist_type("btree_node") .blocklist_type("bch_extent_crc32") @@ -48,6 +50,11 @@ fn main() { .blocklist_type("srcu_struct") .allowlist_var("BCH_.*") .allowlist_var("KEY_SPEC_.*") + .allowlist_var("bch.*") + .allowlist_var("POS_MIN") + .allowlist_var("POS_MAX") + .allowlist_var("SPOS_MAX") + .blocklist_item("bch2_bkey_ops") .allowlist_type("bch_kdf_types") .allowlist_type("bch_sb_field_.*") .allowlist_type("bch_encrypted_key") @@ -56,9 +63,14 @@ fn main() { .allowlist_function("bch2_err_str") .newtype_enum("bch_kdf_types") .opaque_type("gendisk") - .opaque_type("bkey") .opaque_type("gc_stripe") .opaque_type("open_bucket.*") + .opaque_type("replicas_delta_list") + .no_copy("btree_trans") + .no_copy("printbuf") + .no_partialeq("bkey") + .no_partialeq("bpos") + .generate_inline_functions(true) .generate() .expect("BindGen Generation Failiure: [libbcachefs_wrapper]"); bindings |