akiradeveloper / azbuse

Block device in userspace.
MIT License
7 stars 0 forks source link

Use bitflags to import Linux kernel flags #27

Open akiradeveloper opened 3 years ago

akiradeveloper commented 3 years ago

https://docs.rs/bitflags/1.2.1/bitflags/

akiradeveloper commented 3 years ago

The req type is backward compatible but the req flag isn't backward compatible.

We should

  1. Use cfg to switch the ABI version (like this https://github.com/zargony/fuse-rs/blob/master/fuse-abi/src/lib.rs). Enumeration https://doc.rust-lang.org/reference/items/enumerations.html
  2. Import include/linux/blk-type.h in some way (like this https://github.com/holmessherlock/kernel-wrapper/blob/master/build.rs)
akiradeveloper commented 3 years ago

CGROUP_PUNT has appeared in 5.3 http://tomoyo.osdn.jp/cgi-bin/lxr/source/include/linux/blk_types.h?v=linux-5.3.18

akiradeveloper commented 3 years ago

The way io-uring does looks good to me https://github.com/tokio-rs/io-uring/blob/master/build.rs