Add ioprio_set() support for DragonFlyBSD
[fio.git] / options.c
index e8c0b7f3a6f85367971db58b1e40f5f6bf13e165..4723e414c68ccd1e4b83500c95c9ca87c9a81b48 100644 (file)
--- a/options.c
+++ b/options.c
@@ -2190,6 +2190,7 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
                .group  = FIO_OPT_G_INVALID,
        },
 #else
+       {
                .name   = "fadvise_stream",
                .lname  = "Fadvise stream",
                .type   = FIO_OPT_UNSUPPORTED,
@@ -2259,6 +2260,7 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
                .group  = FIO_OPT_G_INVALID,
        },
 #else
+       {
                .name   = "sync_file_range",
                .lname  = "Sync file range",
                .type   = FIO_OPT_UNSUPPORTED,
@@ -2700,7 +2702,7 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
                .name   = "verify_async_cpus",
                .lname  = "Async verify CPUs",
                .type   = FIO_OPT_UNSUPPORTED,
-               .help   "Your platform does not support CPU affinities",
+               .help   "Your platform does not support CPU affinities",
        },
 #endif
        {
@@ -3010,36 +3012,42 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
                .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,
        },
+#else
+       {
+               .name   = "prio",
+               .lname  = "I/O nice priority",
+               .type   = FIO_OPT_UNSUPPORTED,
+               .help   = "Your platform does not support IO priorities",
+       },
+#endif
+#ifdef FIO_HAVE_IOPRIO_CLASS
+#ifndef FIO_HAVE_IOPRIO
+#error "FIO_HAVE_IOPRIO_CLASS requires FIO_HAVE_IOPRIO"
+#endif
        {
                .name   = "prioclass",
                .lname  = "I/O nice 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,
        },
 #else
-       {
-               .name   = "prio",
-               .lname  = "I/O nice priority",
-               .type   = FIO_OPT_UNSUPPORTED,
-               .help   = "Your platform does not support IO priorities",
-       },
        {
                .name   = "prioclass",
                .lname  = "I/O nice priority class",
                .type   = FIO_OPT_UNSUPPORTED,
-               .help   = "Your platform does not support IO priorities",
+               .help   = "Your platform does not support IO priority classes",
        },
 #endif
        {