diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-05-08 21:48:36 +0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-05-08 21:48:36 +0400 |
commit | 7a34912d90c17a90d9fad12c4c51833b4e70707b (patch) | |
tree | a3811697f5eba3c5d12216ac76f681420046b219 /include/linux/ioprio.h | |
parent | 0f1bce41fed02e45f31c2409f29e69e1fedebcdc (diff) | |
parent | 75065ff619e42fe35178eda863cbcddd57776794 (diff) | |
download | linux-7a34912d90c17a90d9fad12c4c51833b4e70707b.tar.xz |
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
* 'for-linus' of git://git.kernel.dk/linux-2.6-block:
Revert "relay: fix splice problem"
docbook: fix bio missing parameter
block: use unitialized_var() in bio_alloc_bioset()
block: avoid duplicate calls to get_part() in disk stat code
cfq-iosched: make io priorities inherit CPU scheduling class as well as nice
block: optimize generic_unplug_device()
block: get rid of likely/unlikely predictions in merge logic
vfs: splice remove_suid() cleanup
cfq-iosched: fix RCU race in the cfq io_context destructor handling
block: adjust tagging function queue bit locking
block: sysfs store function needs to grab queue_lock and use queue_flag_*()
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) } /* + * This is for the case where the task hasn't asked for a specific IO class. + * Check for idle and rt task process, and return appropriate IO class. + */ +static inline int task_nice_ioclass(struct task_struct *task) +{ + if (task->policy == SCHED_IDLE) + return IOPRIO_CLASS_IDLE; + else if (task->policy == SCHED_FIFO || task->policy == SCHED_RR) + return IOPRIO_CLASS_RT; + else + return IOPRIO_CLASS_BE; +} + +/* * For inheritance, return the highest of the two given priorities */ extern int ioprio_best(unsigned short aprio, unsigned short bprio); |