X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=include%2Flinux%2Fioprio.h;h=76dad48088474462b5f21deeff0414b40aca6b8e;hb=0a484bd5d67e0fc458945eeece251be35756a815;hp=2a3bb1bb74336f27c27f6627153900d46d6c178a;hpb=8f859016ea49cd8d7c743533bd1ab3db9a813ffa;p=pandora-kernel.git diff --git a/include/linux/ioprio.h b/include/linux/ioprio.h index 2a3bb1bb7433..76dad4808847 100644 --- a/include/linux/ioprio.h +++ b/include/linux/ioprio.h @@ -67,9 +67,25 @@ static inline int task_nice_ioprio(struct task_struct *task) return (task_nice(task) + 20) / 5; } +/* + * 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); +extern int set_task_ioprio(struct task_struct *task, int ioprio); + #endif