aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/sunrpc
diff options
context:
space:
mode:
authorAlexandros Batsakis <batsakis@netapp.com>2009-12-15 00:27:55 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2009-12-15 13:53:54 -0500
commitcf3b01b54880debb01ea7d471123da5887a7c2cb (patch)
tree54fc0c9014297706e1c7f760d6e0396d24954a68 /include/linux/sunrpc
parent40ead580ae70bba1f66f426aeb938051e4e83900 (diff)
rpc: add a new priority in RPC task
Signed-off-by: Alexandros Batsakis <batsakis@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'include/linux/sunrpc')
-rw-r--r--include/linux/sunrpc/sched.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h
index 9157405f9320..7bc7fd5291ce 100644
--- a/include/linux/sunrpc/sched.h
+++ b/include/linux/sunrpc/sched.h
@@ -173,7 +173,8 @@ struct rpc_task_setup {
173#define RPC_PRIORITY_LOW (-1) 173#define RPC_PRIORITY_LOW (-1)
174#define RPC_PRIORITY_NORMAL (0) 174#define RPC_PRIORITY_NORMAL (0)
175#define RPC_PRIORITY_HIGH (1) 175#define RPC_PRIORITY_HIGH (1)
176#define RPC_NR_PRIORITY (1 + RPC_PRIORITY_HIGH - RPC_PRIORITY_LOW) 176#define RPC_PRIORITY_PRIVILEGED (2)
177#define RPC_NR_PRIORITY (1 + RPC_PRIORITY_PRIVILEGED - RPC_PRIORITY_LOW)
177 178
178struct rpc_timer { 179struct rpc_timer {
179 struct timer_list timer; 180 struct timer_list timer;
@@ -255,6 +256,16 @@ static inline int rpc_wait_for_completion_task(struct rpc_task *task)
255 return __rpc_wait_for_completion_task(task, NULL); 256 return __rpc_wait_for_completion_task(task, NULL);
256} 257}
257 258
259static inline void rpc_task_set_priority(struct rpc_task *task, unsigned char prio)
260{
261 task->tk_priority = prio - RPC_PRIORITY_LOW;
262}
263
264static inline int rpc_task_has_priority(struct rpc_task *task, unsigned char prio)
265{
266 return (task->tk_priority + RPC_PRIORITY_LOW == prio);
267}
268
258#ifdef RPC_DEBUG 269#ifdef RPC_DEBUG
259static inline const char * rpc_qname(struct rpc_wait_queue *q) 270static inline const char * rpc_qname(struct rpc_wait_queue *q)
260{ 271{