aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ioprio.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/ioprio.h')
-rw-r--r--include/linux/ioprio.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/include/linux/ioprio.h b/include/linux/ioprio.h
index baf29387cab4..2a3bb1bb7433 100644
--- a/include/linux/ioprio.h
+++ b/include/linux/ioprio.h
@@ -2,6 +2,7 @@
2#define IOPRIO_H 2#define IOPRIO_H
3 3
4#include <linux/sched.h> 4#include <linux/sched.h>
5#include <linux/iocontext.h>
5 6
6/* 7/*
7 * Gives us 8 prio classes with 13-bits of data for each class 8 * Gives us 8 prio classes with 13-bits of data for each class
@@ -45,18 +46,18 @@ enum {
45 * the cpu scheduler nice value to an io priority 46 * the cpu scheduler nice value to an io priority
46 */ 47 */
47#define IOPRIO_NORM (4) 48#define IOPRIO_NORM (4)
48static inline int task_ioprio(struct task_struct *task) 49static inline int task_ioprio(struct io_context *ioc)
49{ 50{
50 if (ioprio_valid(task->ioprio)) 51 if (ioprio_valid(ioc->ioprio))
51 return IOPRIO_PRIO_DATA(task->ioprio); 52 return IOPRIO_PRIO_DATA(ioc->ioprio);
52 53
53 return IOPRIO_NORM; 54 return IOPRIO_NORM;
54} 55}
55 56
56static inline int task_ioprio_class(struct task_struct *task) 57static inline int task_ioprio_class(struct io_context *ioc)
57{ 58{
58 if (ioprio_valid(task->ioprio)) 59 if (ioprio_valid(ioc->ioprio))
59 return IOPRIO_PRIO_CLASS(task->ioprio); 60 return IOPRIO_PRIO_CLASS(ioc->ioprio);
60 61
61 return IOPRIO_CLASS_BE; 62 return IOPRIO_CLASS_BE;
62} 63}