summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
a306497)
There is a kernel that supports I/O priority with a syscall similar
to Linux (e.g. DragonFlyBSD's ioprio_set(2) which apparently seems
to have been inspired by ioprio_set(2) in Linux kernel), however
min/max value of the priority may differ, so use OS specific macros
instead of hardcoded values that are designed to work on Linux.
This commit adds IOPRIO_MIN|MAX_PRIO and IOPRIO_MIN|MAX_PRIO_CLASS
to Linux (incl Android), but no functional changes.
Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro@gmail.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
.type = FIO_OPT_INT,
.off1 = td_var_offset(ioprio),
.help = "Set job IO priority value",
.type = FIO_OPT_INT,
.off1 = td_var_offset(ioprio),
.help = "Set job IO priority value",
- .minval = 0,
- .maxval = 7,
+ .minval = IOPRIO_MIN_PRIO,
+ .maxval = IOPRIO_MAX_PRIO,
.interval = 1,
.category = FIO_OPT_C_GENERAL,
.group = FIO_OPT_G_CRED,
.interval = 1,
.category = FIO_OPT_C_GENERAL,
.group = FIO_OPT_G_CRED,
.type = FIO_OPT_INT,
.off1 = td_var_offset(ioprio_class),
.help = "Set job IO priority class",
.type = FIO_OPT_INT,
.off1 = td_var_offset(ioprio_class),
.help = "Set job IO priority class",
- .minval = 0,
- .maxval = 3,
+ .minval = IOPRIO_MIN_PRIO_CLASS,
+ .maxval = IOPRIO_MAX_PRIO_CLASS,
.interval = 1,
.category = FIO_OPT_C_GENERAL,
.group = FIO_OPT_G_CRED,
.interval = 1,
.category = FIO_OPT_C_GENERAL,
.group = FIO_OPT_G_CRED,
#define IOPRIO_BITS 16
#define IOPRIO_CLASS_SHIFT 13
#define IOPRIO_BITS 16
#define IOPRIO_CLASS_SHIFT 13
+#define IOPRIO_MIN_PRIO 0 /* highest priority */
+#define IOPRIO_MAX_PRIO 7 /* lowest priority */
+
+#define IOPRIO_MIN_PRIO_CLASS 0
+#define IOPRIO_MAX_PRIO_CLASS 3
+
static inline int ioprio_set(int which, int who, int ioprio_class, int ioprio)
{
/*
static inline int ioprio_set(int which, int who, int ioprio_class, int ioprio)
{
/*
#define IOPRIO_BITS 16
#define IOPRIO_CLASS_SHIFT 13
#define IOPRIO_BITS 16
#define IOPRIO_CLASS_SHIFT 13
+#define IOPRIO_MIN_PRIO 0 /* highest priority */
+#define IOPRIO_MAX_PRIO 7 /* lowest priority */
+
+#define IOPRIO_MIN_PRIO_CLASS 0
+#define IOPRIO_MAX_PRIO_CLASS 3
+
static inline int ioprio_set(int which, int who, int ioprio_class, int ioprio)
{
/*
static inline int ioprio_set(int which, int who, int ioprio_class, int ioprio)
{
/*