aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/sunrpc/sched.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-01-30 03:54:24 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2008-01-30 03:54:24 -0500
commit85004cc367abc000aa36c0d0e270ab609a68b0cb (patch)
tree5739aae778d67b6d119fe5c668313fc2823e9836 /include/linux/sunrpc/sched.h
parent149a051f82d2b3860fe32fa182dbc83a66274894 (diff)
parent3fbd67ad61f6d5a09ea717b56c50bc5c3d8042a8 (diff)
Merge git://git.linux-nfs.org/pub/linux/nfs-2.6
* git://git.linux-nfs.org/pub/linux/nfs-2.6: (118 commits) NFSv4: Iterate through all nfs_clients when the server recalls a delegation NFSv4: Deal more correctly with duplicate delegations NFS: Fix a potential race between umount and nfs_access_cache_shrinker() NFS: Add an asynchronous delegreturn operation for use in nfs_clear_inode nfs: convert NFS_*(inode) helpers to static inline nfs: obliterate NFS_FLAGS macro NFS: Address memory leaks in the NFS client mount option parser nfs4: allow nfsv4 acls on non-regular-files NFS: Optimise away the sigmask code in aio/dio reads and writes SUNRPC: Don't bother changing the sigmask for asynchronous RPC calls SUNRPC: rpcb_getport_sync() passes incorrect address size to rpc_create() SUNRPC: Clean up block comment preceding rpcb_getport_sync() SUNRPC: Use appropriate argument types in rpcb client SUNRPC: rpcb_getport_sync() should use built-in hostname generator SUNRPC: Clean up functions that free address_strings array NFS: NFS version number is unsigned NLM: Fix a bogus 'return' in nlmclnt_rpc_release NLM: Introduce an arguments structure for nlmclnt_init() NLM/NFS: Use cached nlm_host when calling nlmclnt_proc() NFS: Invoke nlmclnt_init during NFS mount processing ...
Diffstat (limited to 'include/linux/sunrpc/sched.h')
-rw-r--r--include/linux/sunrpc/sched.h57
1 files changed, 19 insertions, 38 deletions
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h
index 8ea077db0099..ce3d1b132729 100644
--- a/include/linux/sunrpc/sched.h
+++ b/include/linux/sunrpc/sched.h
@@ -56,8 +56,6 @@ struct rpc_task {
56 __u8 tk_garb_retry; 56 __u8 tk_garb_retry;
57 __u8 tk_cred_retry; 57 __u8 tk_cred_retry;
58 58
59 unsigned long tk_cookie; /* Cookie for batching tasks */
60
61 /* 59 /*
62 * timeout_fn to be executed by timer bottom half 60 * timeout_fn to be executed by timer bottom half
63 * callback to be executed after waking up 61 * callback to be executed after waking up
@@ -78,7 +76,6 @@ struct rpc_task {
78 struct timer_list tk_timer; /* kernel timer */ 76 struct timer_list tk_timer; /* kernel timer */
79 unsigned long tk_timeout; /* timeout for rpc_sleep() */ 77 unsigned long tk_timeout; /* timeout for rpc_sleep() */
80 unsigned short tk_flags; /* misc flags */ 78 unsigned short tk_flags; /* misc flags */
81 unsigned char tk_priority : 2;/* Task priority */
82 unsigned long tk_runstate; /* Task run status */ 79 unsigned long tk_runstate; /* Task run status */
83 struct workqueue_struct *tk_workqueue; /* Normally rpciod, but could 80 struct workqueue_struct *tk_workqueue; /* Normally rpciod, but could
84 * be any workqueue 81 * be any workqueue
@@ -94,6 +91,9 @@ struct rpc_task {
94 unsigned long tk_start; /* RPC task init timestamp */ 91 unsigned long tk_start; /* RPC task init timestamp */
95 long tk_rtt; /* round-trip time (jiffies) */ 92 long tk_rtt; /* round-trip time (jiffies) */
96 93
94 pid_t tk_owner; /* Process id for batching tasks */
95 unsigned char tk_priority : 2;/* Task priority */
96
97#ifdef RPC_DEBUG 97#ifdef RPC_DEBUG
98 unsigned short tk_pid; /* debugging aid */ 98 unsigned short tk_pid; /* debugging aid */
99#endif 99#endif
@@ -117,6 +117,15 @@ struct rpc_call_ops {
117 void (*rpc_release)(void *); 117 void (*rpc_release)(void *);
118}; 118};
119 119
120struct rpc_task_setup {
121 struct rpc_task *task;
122 struct rpc_clnt *rpc_client;
123 const struct rpc_message *rpc_message;
124 const struct rpc_call_ops *callback_ops;
125 void *callback_data;
126 unsigned short flags;
127 signed char priority;
128};
120 129
121/* 130/*
122 * RPC task flags 131 * RPC task flags
@@ -180,10 +189,10 @@ struct rpc_call_ops {
180 * Note: if you change these, you must also change 189 * Note: if you change these, you must also change
181 * the task initialization definitions below. 190 * the task initialization definitions below.
182 */ 191 */
183#define RPC_PRIORITY_LOW 0 192#define RPC_PRIORITY_LOW (-1)
184#define RPC_PRIORITY_NORMAL 1 193#define RPC_PRIORITY_NORMAL (0)
185#define RPC_PRIORITY_HIGH 2 194#define RPC_PRIORITY_HIGH (1)
186#define RPC_NR_PRIORITY (RPC_PRIORITY_HIGH+1) 195#define RPC_NR_PRIORITY (1 + RPC_PRIORITY_HIGH - RPC_PRIORITY_LOW)
187 196
188/* 197/*
189 * RPC synchronization objects 198 * RPC synchronization objects
@@ -191,7 +200,7 @@ struct rpc_call_ops {
191struct rpc_wait_queue { 200struct rpc_wait_queue {
192 spinlock_t lock; 201 spinlock_t lock;
193 struct list_head tasks[RPC_NR_PRIORITY]; /* task queue for each priority level */ 202 struct list_head tasks[RPC_NR_PRIORITY]; /* task queue for each priority level */
194 unsigned long cookie; /* cookie of last task serviced */ 203 pid_t owner; /* process id of last task serviced */
195 unsigned char maxpriority; /* maximum priority (0 if queue is not a priority queue) */ 204 unsigned char maxpriority; /* maximum priority (0 if queue is not a priority queue) */
196 unsigned char priority; /* current priority */ 205 unsigned char priority; /* current priority */
197 unsigned char count; /* # task groups remaining serviced so far */ 206 unsigned char count; /* # task groups remaining serviced so far */
@@ -208,41 +217,13 @@ struct rpc_wait_queue {
208 * performance of NFS operations such as read/write. 217 * performance of NFS operations such as read/write.
209 */ 218 */
210#define RPC_BATCH_COUNT 16 219#define RPC_BATCH_COUNT 16
211
212#ifndef RPC_DEBUG
213# define RPC_WAITQ_INIT(var,qname) { \
214 .lock = __SPIN_LOCK_UNLOCKED(var.lock), \
215 .tasks = { \
216 [0] = LIST_HEAD_INIT(var.tasks[0]), \
217 [1] = LIST_HEAD_INIT(var.tasks[1]), \
218 [2] = LIST_HEAD_INIT(var.tasks[2]), \
219 }, \
220 }
221#else
222# define RPC_WAITQ_INIT(var,qname) { \
223 .lock = __SPIN_LOCK_UNLOCKED(var.lock), \
224 .tasks = { \
225 [0] = LIST_HEAD_INIT(var.tasks[0]), \
226 [1] = LIST_HEAD_INIT(var.tasks[1]), \
227 [2] = LIST_HEAD_INIT(var.tasks[2]), \
228 }, \
229 .name = qname, \
230 }
231#endif
232# define RPC_WAITQ(var,qname) struct rpc_wait_queue var = RPC_WAITQ_INIT(var,qname)
233
234#define RPC_IS_PRIORITY(q) ((q)->maxpriority > 0) 220#define RPC_IS_PRIORITY(q) ((q)->maxpriority > 0)
235 221
236/* 222/*
237 * Function prototypes 223 * Function prototypes
238 */ 224 */
239struct rpc_task *rpc_new_task(struct rpc_clnt *, int flags, 225struct rpc_task *rpc_new_task(const struct rpc_task_setup *);
240 const struct rpc_call_ops *ops, void *data); 226struct rpc_task *rpc_run_task(const struct rpc_task_setup *);
241struct rpc_task *rpc_run_task(struct rpc_clnt *clnt, int flags,
242 const struct rpc_call_ops *ops, void *data);
243void rpc_init_task(struct rpc_task *task, struct rpc_clnt *clnt,
244 int flags, const struct rpc_call_ops *ops,
245 void *data);
246void rpc_put_task(struct rpc_task *); 227void rpc_put_task(struct rpc_task *);
247void rpc_exit_task(struct rpc_task *); 228void rpc_exit_task(struct rpc_task *);
248void rpc_release_calldata(const struct rpc_call_ops *, void *); 229void rpc_release_calldata(const struct rpc_call_ops *, void *);