Skip to content

Commit

Permalink
libublk: prepare for supporting BPF
Browse files Browse the repository at this point in the history
Signed-off-by: Ming Lei <[email protected]>
  • Loading branch information
ming1 committed Aug 20, 2024
1 parent 050b596 commit a804d4b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ctrl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -943,7 +943,8 @@ impl UblkCtrl {
| sys::UBLK_F_UNPRIVILEGED_DEV
| sys::UBLK_F_CMD_IOCTL_ENCODE
| sys::UBLK_F_USER_COPY
| sys::UBLK_F_ZONED) as u64;
| sys::UBLK_F_ZONED
| sys::UBLK_F_BPF) as u64;

fn get_inner(&self) -> std::sync::RwLockReadGuard<UblkCtrlInner> {
self.inner.read().unwrap()
Expand Down
3 changes: 3 additions & 0 deletions ublk_cmd.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,9 @@
*/
#define UBLK_F_ZONED (1ULL << 8)

/* ublk IO is handled by bpf prog */
#define UBLK_F_BPF (1UL << 9)

/* device state */
#define UBLK_S_DEV_DEAD 0
#define UBLK_S_DEV_LIVE 1
Expand Down

0 comments on commit a804d4b

Please sign in to comment.