Commit | Line | Data |
---|---|---|
e9f6567a DLM |
1 | /* |
2 | * IO priority handling declarations and helper functions common to the | |
3 | * libaio and io_uring engines. | |
4 | */ | |
5 | ||
6 | #ifndef FIO_CMDPRIO_H | |
7 | #define FIO_CMDPRIO_H | |
8 | ||
9 | #include "../fio.h" | |
10 | ||
a5af2a8b NC |
11 | /* read and writes only, no trim */ |
12 | #define CMDPRIO_RWDIR_CNT 2 | |
13 | ||
97f2d484 NC |
14 | enum { |
15 | CMDPRIO_MODE_NONE, | |
16 | CMDPRIO_MODE_PERC, | |
17 | CMDPRIO_MODE_BSSPLIT, | |
18 | }; | |
19 | ||
d6cbeab4 | 20 | struct cmdprio_options { |
a5af2a8b NC |
21 | unsigned int percentage[CMDPRIO_RWDIR_CNT]; |
22 | unsigned int class[CMDPRIO_RWDIR_CNT]; | |
23 | unsigned int level[CMDPRIO_RWDIR_CNT]; | |
d6cbeab4 NC |
24 | char *bssplit_str; |
25 | }; | |
26 | ||
27 | struct cmdprio { | |
28 | struct cmdprio_options *options; | |
a5af2a8b NC |
29 | unsigned int bssplit_nr[CMDPRIO_RWDIR_CNT]; |
30 | struct bssplit *bssplit[CMDPRIO_RWDIR_CNT]; | |
97f2d484 | 31 | unsigned int mode; |
e9f6567a DLM |
32 | }; |
33 | ||
127715b6 NC |
34 | bool fio_cmdprio_set_ioprio(struct thread_data *td, struct cmdprio *cmdprio, |
35 | struct io_u *io_u); | |
a48f0cc7 | 36 | |
d6cbeab4 NC |
37 | void fio_cmdprio_cleanup(struct cmdprio *cmdprio); |
38 | ||
39 | int fio_cmdprio_init(struct thread_data *td, struct cmdprio *cmdprio, | |
40 | struct cmdprio_options *options); | |
e9f6567a DLM |
41 | |
42 | #endif |