scsi: block: ioprio: Clean up interface definition
[linux-2.6-microblaze.git] / include / uapi / linux / ioprio.h
index f70f259..4444b4e 100644 (file)
@@ -17,7 +17,7 @@
         ((data) & IOPRIO_PRIO_MASK))
 
 /*
- * These are the io priority groups as implemented by the BFQ and mq-deadline
+ * These are the io priority classes as implemented by the BFQ and mq-deadline
  * schedulers. RT is the realtime class, it always gets premium service. For
  * ATA disks supporting NCQ IO priority, RT class IOs will be processed using
  * high priority NCQ commands. BE is the best-effort scheduling class, the
@@ -32,11 +32,20 @@ enum {
 };
 
 /*
- * The RT and BE priority classes both support up to 8 priority levels.
+ * The RT and BE priority classes both support up to 8 priority levels that
+ * can be specified using the lower 3-bits of the priority data.
  */
-#define IOPRIO_NR_LEVELS       8
-#define IOPRIO_BE_NR           IOPRIO_NR_LEVELS
+#define IOPRIO_LEVEL_NR_BITS           3
+#define IOPRIO_NR_LEVELS               (1 << IOPRIO_LEVEL_NR_BITS)
+#define IOPRIO_LEVEL_MASK              (IOPRIO_NR_LEVELS - 1)
+#define IOPRIO_PRIO_LEVEL(ioprio)      ((ioprio) & IOPRIO_LEVEL_MASK)
 
+#define IOPRIO_BE_NR                   IOPRIO_NR_LEVELS
+
+/*
+ * Possible values for the "which" argument of the ioprio_get() and
+ * ioprio_set() system calls (see "man ioprio_set").
+ */
 enum {
        IOPRIO_WHO_PROCESS = 1,
        IOPRIO_WHO_PGRP,
@@ -44,7 +53,7 @@ enum {
 };
 
 /*
- * Fallback BE priority level.
+ * Fallback BE class priority level.
  */
 #define IOPRIO_NORM    4
 #define IOPRIO_BE_NORM IOPRIO_NORM