ioprio.h revision 4b29af0a1b8b25b43e4c0cb9bf066c52f3add9bd
1/****************************************************************************
2 ****************************************************************************
3 ***
4 ***   This header was automatically generated from a Linux kernel header
5 ***   of the same name, to make information necessary for userspace to
6 ***   call into the kernel available to libc.  It contains only constants,
7 ***   structures, and macros generated from the original header, and thus,
8 ***   contains no copyrightable information.
9 ***
10 ****************************************************************************
11 ****************************************************************************/
12#ifndef IOPRIO_H
13#define IOPRIO_H
14
15#include <linux/sched.h>
16
17#define IOPRIO_BITS (16)
18#define IOPRIO_CLASS_SHIFT (13)
19#define IOPRIO_PRIO_MASK ((1UL << IOPRIO_CLASS_SHIFT) - 1)
20
21#define IOPRIO_PRIO_CLASS(mask) ((mask) >> IOPRIO_CLASS_SHIFT)
22#define IOPRIO_PRIO_DATA(mask) ((mask) & IOPRIO_PRIO_MASK)
23#define IOPRIO_PRIO_VALUE(class, data) (((class) << IOPRIO_CLASS_SHIFT) | data)
24
25#define ioprio_valid(mask) (IOPRIO_PRIO_CLASS((mask)) != IOPRIO_CLASS_NONE)
26
27enum {
28 IOPRIO_CLASS_NONE,
29 IOPRIO_CLASS_RT,
30 IOPRIO_CLASS_BE,
31 IOPRIO_CLASS_IDLE,
32};
33
34#define IOPRIO_BE_NR (8)
35
36enum {
37 IOPRIO_WHO_PROCESS = 1,
38 IOPRIO_WHO_PGRP,
39 IOPRIO_WHO_USER,
40};
41
42#define IOPRIO_NORM (4)
43
44#endif
45