cmdprio: add mode to make the logic easier to reason about
[fio.git] / engines / cmdprio.h
CommitLineData
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
14enum {
15 CMDPRIO_MODE_NONE,
16 CMDPRIO_MODE_PERC,
17 CMDPRIO_MODE_BSSPLIT,
18};
19
e9f6567a 20struct cmdprio {
a5af2a8b
NC
21 unsigned int percentage[CMDPRIO_RWDIR_CNT];
22 unsigned int class[CMDPRIO_RWDIR_CNT];
23 unsigned int level[CMDPRIO_RWDIR_CNT];
24 unsigned int bssplit_nr[CMDPRIO_RWDIR_CNT];
25 struct bssplit *bssplit[CMDPRIO_RWDIR_CNT];
97f2d484 26 unsigned int mode;
e9f6567a
DLM
27};
28
e27b9ff0
NC
29int fio_cmdprio_bssplit_parse(struct thread_data *td, const char *input,
30 struct cmdprio *cmdprio);
a48f0cc7 31
127715b6
NC
32bool fio_cmdprio_set_ioprio(struct thread_data *td, struct cmdprio *cmdprio,
33 struct io_u *io_u);
a48f0cc7 34
97f2d484 35int fio_cmdprio_init(struct thread_data *td, struct cmdprio *cmdprio);
e9f6567a
DLM
36
37#endif