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>
This commit is contained in:
parent
40ead580ae
commit
cf3b01b548
|
@ -173,7 +173,8 @@ struct rpc_task_setup {
|
||||||
#define RPC_PRIORITY_LOW (-1)
|
#define RPC_PRIORITY_LOW (-1)
|
||||||
#define RPC_PRIORITY_NORMAL (0)
|
#define RPC_PRIORITY_NORMAL (0)
|
||||||
#define RPC_PRIORITY_HIGH (1)
|
#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 rpc_timer {
|
||||||
struct timer_list timer;
|
struct timer_list timer;
|
||||||
|
@ -255,6 +256,16 @@ static inline int rpc_wait_for_completion_task(struct rpc_task *task)
|
||||||
return __rpc_wait_for_completion_task(task, NULL);
|
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
|
#ifdef RPC_DEBUG
|
||||||
static inline const char * rpc_qname(struct rpc_wait_queue *q)
|
static inline const char * rpc_qname(struct rpc_wait_queue *q)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue