Make I/O priority option generic for non-Linux environment [2/2]
authorTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Tue, 19 Jul 2016 16:33:44 +0000 (01:33 +0900)
committerJens Axboe <axboe@fb.com>
Tue, 19 Jul 2016 21:45:49 +0000 (15:45 -0600)
commit32ef447a6da7b75320d4a4f3a7804e0f82de6c4d
treeb8e4e35561c90ef7e72b35dfb0b48740986fe3b4
parent1767bd34cdc1a7607a8460b8173d08d7954adf99
Make I/O priority option generic for non-Linux environment [2/2]

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
the idea of class within the syscall may not exist depending on the
I/O scheduler and its design, so "prioclass" option should be an
optional one for "prio" option.

This commit adds FIO_HAVE_IOPRIO_CLASS to separate "prioclass" from
"prio" on compile-time for those that do support priority itself,
but not priority classes.

If the platform supports I/O priority, it defines FIO_HAVE_IOPRIO
like it did before. If the platform supports I/O priority classes,
it defines FIO_HAVE_IOPRIO_CLASS in addition to above.
If FIO_HAVE_IOPRIO_CLASS is enabled, FIO_HAVE_IOPRIO must also be
enabled since FIO_HAVE_IOPRIO defines io_prioset(). This is also
checked on compile-time.

Linux (incl Android) has both of these macros enabled, so there is
no functional changes made by this commit.

Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro@gmail.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
options.c
os/os-android.h
os/os-linux.h