2 * IO priority handling declarations and helper functions common to the
3 * libaio and io_uring engines.
12 unsigned int percentage[DDIR_RWDIR_CNT];
13 unsigned int class[DDIR_RWDIR_CNT];
14 unsigned int level[DDIR_RWDIR_CNT];
17 static int fio_cmdprio_init(struct thread_data *td, struct cmdprio *cmdprio,
20 struct thread_options *to = &td->o;
21 bool has_cmdprio_percentage = false;
25 * If cmdprio_percentage is set and cmdprio_class is not set,
26 * default to RT priority class.
28 for (i = 0; i < DDIR_RWDIR_CNT; i++) {
29 if (cmdprio->percentage[i]) {
30 if (!cmdprio->class[i])
31 cmdprio->class[i] = IOPRIO_CLASS_RT;
32 has_cmdprio_percentage = true;
37 * Check for option conflicts
39 if (has_cmdprio_percentage &&
40 (fio_option_is_set(to, ioprio) ||
41 fio_option_is_set(to, ioprio_class))) {
42 log_err("%s: cmdprio_percentage option and mutually exclusive "
43 "prio or prioclass option is set, exiting\n",
48 *has_cmdprio = has_cmdprio_percentage;