summaryrefslogtreecommitdiff
path: root/bch_bindgen/src/libbcachefs_wrapper.h
blob: 128592c3ce65bc5d140b37b2576dc793ff4b3265 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include "libbcachefs/super-io.h"
#include "libbcachefs/checksum.h"
#include "libbcachefs/bcachefs_format.h"
#include "libbcachefs/btree_cache.h"
#include "libbcachefs/btree_iter.h"
#include "libbcachefs/debug.h"
#include "libbcachefs/errcode.h"
#include "libbcachefs/error.h"
#include "libbcachefs/opts.h"
#include "libbcachefs.h"
#include "crypto.h"
#include "include/linux/bio.h"
#include "include/linux/blkdev.h"
#include "cmds.h"
#include "raid/raid.h"

/* Fix753 is a workaround for https://github.com/rust-lang/rust-bindgen/issues/753
 * Functional macro are not expanded with bindgen, e.g. ioctl are automatically ignored
 * from the generation
 *
 * To avoid this, use `MARK_FIX_753` to force the synthesis of your macro constant.
 * It will appear in Rust with its proper name and not Fix753_{name}.
 */

/* MARK_FIX_753: force generate a macro constant in Rust
 *
 * @type_name   - a type for this constant
 * @req_name    - a name for this constant which will be used inside of Rust
 */
#define MARK_FIX_753(type_name, req_name) const type_name Fix753_##req_name = req_name;

MARK_FIX_753(blk_mode_t, BLK_OPEN_READ);
MARK_FIX_753(blk_mode_t, BLK_OPEN_WRITE);
MARK_FIX_753(blk_mode_t, BLK_OPEN_EXCL);

MARK_FIX_753(__u32, BCH_IOCTL_SUBVOLUME_CREATE);
MARK_FIX_753(__u32, BCH_IOCTL_SUBVOLUME_DESTROY);