diff options
Diffstat (limited to 'include/linux/ioprio.h')
-rw-r--r-- | include/linux/ioprio.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/linux/ioprio.h b/include/linux/ioprio.h index 2a3bb1bb7433..f98a656b17e5 100644 --- a/include/linux/ioprio.h +++ b/include/linux/ioprio.h | |||
@@ -68,6 +68,20 @@ static inline int task_nice_ioprio(struct task_struct *task) | |||
68 | } | 68 | } |
69 | 69 | ||
70 | /* | 70 | /* |
71 | * This is for the case where the task hasn't asked for a specific IO class. | ||
72 | * Check for idle and rt task process, and return appropriate IO class. | ||
73 | */ | ||
74 | static inline int task_nice_ioclass(struct task_struct *task) | ||
75 | { | ||
76 | if (task->policy == SCHED_IDLE) | ||
77 | return IOPRIO_CLASS_IDLE; | ||
78 | else if (task->policy == SCHED_FIFO || task->policy == SCHED_RR) | ||
79 | return IOPRIO_CLASS_RT; | ||
80 | else | ||
81 | return IOPRIO_CLASS_BE; | ||
82 | } | ||
83 | |||
84 | /* | ||
71 | * For inheritance, return the highest of the two given priorities | 85 | * For inheritance, return the highest of the two given priorities |
72 | */ | 86 | */ |
73 | extern int ioprio_best(unsigned short aprio, unsigned short bprio); | 87 | extern int ioprio_best(unsigned short aprio, unsigned short bprio); |