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.h22
1 files changed, 5 insertions, 17 deletions
diff --git a/include/linux/ioprio.h b/include/linux/ioprio.h
index 76dad4808847..beb9ce1c2c23 100644
--- a/include/linux/ioprio.h
+++ b/include/linux/ioprio.h
@@ -42,26 +42,14 @@ enum {
42}; 42};
43 43
44/* 44/*
45 * if process has set io priority explicitly, use that. if not, convert 45 * Fallback BE priority
46 * the cpu scheduler nice value to an io priority
47 */ 46 */
48#define IOPRIO_NORM (4) 47#define IOPRIO_NORM (4)
49static inline int task_ioprio(struct io_context *ioc)
50{
51 if (ioprio_valid(ioc->ioprio))
52 return IOPRIO_PRIO_DATA(ioc->ioprio);
53
54 return IOPRIO_NORM;
55}
56
57static inline int task_ioprio_class(struct io_context *ioc)
58{
59 if (ioprio_valid(ioc->ioprio))
60 return IOPRIO_PRIO_CLASS(ioc->ioprio);
61
62 return IOPRIO_CLASS_BE;
63}
64 48
49/*
50 * if process has set io priority explicitly, use that. if not, convert
51 * the cpu scheduler nice value to an io priority
52 */
65static inline int task_nice_ioprio(struct task_struct *task) 53static inline int task_nice_ioprio(struct task_struct *task)
66{ 54{
67 return (task_nice(task) + 20) / 5; 55 return (task_nice(task) + 20) / 5;