libaio,io_uring: move common cmdprio_prep() code to cmdprio
[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
e9f6567a 14struct cmdprio {
a5af2a8b
NC
15 unsigned int percentage[CMDPRIO_RWDIR_CNT];
16 unsigned int class[CMDPRIO_RWDIR_CNT];
17 unsigned int level[CMDPRIO_RWDIR_CNT];
18 unsigned int bssplit_nr[CMDPRIO_RWDIR_CNT];
19 struct bssplit *bssplit[CMDPRIO_RWDIR_CNT];
e9f6567a
DLM
20};
21
e27b9ff0
NC
22int fio_cmdprio_bssplit_parse(struct thread_data *td, const char *input,
23 struct cmdprio *cmdprio);
a48f0cc7 24
127715b6
NC
25bool fio_cmdprio_set_ioprio(struct thread_data *td, struct cmdprio *cmdprio,
26 struct io_u *io_u);
a48f0cc7 27
e27b9ff0
NC
28int fio_cmdprio_init(struct thread_data *td, struct cmdprio *cmdprio,
29 bool *has_cmdprio);
e9f6567a
DLM
30
31#endif