aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ioprio.h
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2008-01-24 08:52:45 +0100
committerJens Axboe <jens.axboe@oracle.com>2008-01-28 10:50:29 +0100
commitfd0928df98b9578be8a786ac0cb78a47a5e17a20 (patch)
tree70a34cf207bea1bec28e59cf0dba7d20e7f8b0f1 /include/linux/ioprio.h
parent91525300baf162e83e923b09ca286f9205e21522 (diff)
downloadkernel_goldelico_gta04-fd0928df98b9578be8a786ac0cb78a47a5e17a20.zip
kernel_goldelico_gta04-fd0928df98b9578be8a786ac0cb78a47a5e17a20.tar.gz
kernel_goldelico_gta04-fd0928df98b9578be8a786ac0cb78a47a5e17a20.tar.bz2
ioprio: move io priority from task_struct to io_context
This is where it belongs and then it doesn't take up space for a process that doesn't do IO. Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
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 baf2938..2a3bb1b 100644
--- a/include/linux/ioprio.h
+++ b/include/linux/ioprio.h
@@ -2,6 +2,7 @@
#define IOPRIO_H
#include <linux/sched.h>
+#include <linux/iocontext.h>
/*
* Gives us 8 prio classes with 13-bits of data for each class
@@ -45,18 +46,18 @@ enum {
* the cpu scheduler nice value to an io priority
*/
#define IOPRIO_NORM (4)
-static inline int task_ioprio(struct task_struct *task)
+static inline int task_ioprio(struct io_context *ioc)
{
- if (ioprio_valid(task->ioprio))
- return IOPRIO_PRIO_DATA(task->ioprio);
+ if (ioprio_valid(ioc->ioprio))
+ return IOPRIO_PRIO_DATA(ioc->ioprio);
return IOPRIO_NORM;
}
-static inline int task_ioprio_class(struct task_struct *task)
+static inline int task_ioprio_class(struct io_context *ioc)
{
- if (ioprio_valid(task->ioprio))
- return IOPRIO_PRIO_CLASS(task->ioprio);
+ if (ioprio_valid(ioc->ioprio))
+ return IOPRIO_PRIO_CLASS(ioc->ioprio);
return IOPRIO_CLASS_BE;
}