Skip to content

Commit

Permalink
rpc: add a new priority in RPC task
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandros Batsakis <batsakis@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
  • Loading branch information
Alexandros Batsakis authored and Trond Myklebust committed Dec 15, 2009
1 parent 40ead58 commit cf3b01b
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion include/linux/sunrpc/sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@ struct rpc_task_setup {
#define RPC_PRIORITY_LOW (-1)
#define RPC_PRIORITY_NORMAL (0)
#define RPC_PRIORITY_HIGH (1)
#define RPC_NR_PRIORITY (1 + RPC_PRIORITY_HIGH - RPC_PRIORITY_LOW)
#define RPC_PRIORITY_PRIVILEGED (2)
#define RPC_NR_PRIORITY (1 + RPC_PRIORITY_PRIVILEGED - RPC_PRIORITY_LOW)

struct rpc_timer {
struct timer_list timer;
Expand Down Expand Up @@ -255,6 +256,16 @@ static inline int rpc_wait_for_completion_task(struct rpc_task *task)
return __rpc_wait_for_completion_task(task, NULL);
}

static inline void rpc_task_set_priority(struct rpc_task *task, unsigned char prio)
{
task->tk_priority = prio - RPC_PRIORITY_LOW;
}

static inline int rpc_task_has_priority(struct rpc_task *task, unsigned char prio)
{
return (task->tk_priority + RPC_PRIORITY_LOW == prio);
}

#ifdef RPC_DEBUG
static inline const char * rpc_qname(struct rpc_wait_queue *q)
{
Expand Down

0 comments on commit cf3b01b

Please sign in to comment.