aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/lockd/lockd.h18
-rw-r--r--include/linux/lockd/sm_inter.h1
-rw-r--r--include/linux/nfs_fs.h5
-rw-r--r--include/linux/nfs_fs_sb.h10
-rw-r--r--include/linux/nfs_xdr.h10
-rw-r--r--include/linux/sunrpc/auth.h17
-rw-r--r--include/linux/sunrpc/auth_gss.h1
-rw-r--r--include/linux/sunrpc/clnt.h9
-rw-r--r--include/linux/sunrpc/sched.h41
-rw-r--r--include/linux/sunrpc/xprt.h10
10 files changed, 72 insertions, 50 deletions
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h
index 4babb2a129ac..94649a8da014 100644
--- a/include/linux/lockd/lockd.h
+++ b/include/linux/lockd/lockd.h
@@ -91,6 +91,7 @@ struct nlm_wait;
91 */ 91 */
92#define NLMCLNT_OHSIZE ((__NEW_UTS_LEN) + 10u) 92#define NLMCLNT_OHSIZE ((__NEW_UTS_LEN) + 10u)
93struct nlm_rqst { 93struct nlm_rqst {
94 atomic_t a_count;
94 unsigned int a_flags; /* initial RPC task flags */ 95 unsigned int a_flags; /* initial RPC task flags */
95 struct nlm_host * a_host; /* host handle */ 96 struct nlm_host * a_host; /* host handle */
96 struct nlm_args a_args; /* arguments */ 97 struct nlm_args a_args; /* arguments */
@@ -173,8 +174,10 @@ void nlmclnt_next_cookie(struct nlm_cookie *);
173/* 174/*
174 * Host cache 175 * Host cache
175 */ 176 */
176struct nlm_host *nlmclnt_lookup_host(const struct sockaddr_in *, int, int, 177struct nlm_host *nlmclnt_lookup_host(const struct sockaddr_in *sin,
177 const char *, unsigned int); 178 int proto, u32 version,
179 const char *hostname,
180 unsigned int hostname_len);
178struct nlm_host *nlmsvc_lookup_host(struct svc_rqst *, const char *, 181struct nlm_host *nlmsvc_lookup_host(struct svc_rqst *, const char *,
179 unsigned int); 182 unsigned int);
180struct rpc_clnt * nlm_bind_host(struct nlm_host *); 183struct rpc_clnt * nlm_bind_host(struct nlm_host *);
@@ -217,8 +220,7 @@ void nlmsvc_mark_resources(void);
217void nlmsvc_free_host_resources(struct nlm_host *); 220void nlmsvc_free_host_resources(struct nlm_host *);
218void nlmsvc_invalidate_all(void); 221void nlmsvc_invalidate_all(void);
219 222
220static __inline__ struct inode * 223static inline struct inode *nlmsvc_file_inode(struct nlm_file *file)
221nlmsvc_file_inode(struct nlm_file *file)
222{ 224{
223 return file->f_file->f_path.dentry->d_inode; 225 return file->f_file->f_path.dentry->d_inode;
224} 226}
@@ -226,8 +228,8 @@ nlmsvc_file_inode(struct nlm_file *file)
226/* 228/*
227 * Compare two host addresses (needs modifying for ipv6) 229 * Compare two host addresses (needs modifying for ipv6)
228 */ 230 */
229static __inline__ int 231static inline int nlm_cmp_addr(const struct sockaddr_in *sin1,
230nlm_cmp_addr(const struct sockaddr_in *sin1, const struct sockaddr_in *sin2) 232 const struct sockaddr_in *sin2)
231{ 233{
232 return sin1->sin_addr.s_addr == sin2->sin_addr.s_addr; 234 return sin1->sin_addr.s_addr == sin2->sin_addr.s_addr;
233} 235}
@@ -236,8 +238,8 @@ nlm_cmp_addr(const struct sockaddr_in *sin1, const struct sockaddr_in *sin2)
236 * Compare two NLM locks. 238 * Compare two NLM locks.
237 * When the second lock is of type F_UNLCK, this acts like a wildcard. 239 * When the second lock is of type F_UNLCK, this acts like a wildcard.
238 */ 240 */
239static __inline__ int 241static inline int nlm_compare_locks(const struct file_lock *fl1,
240nlm_compare_locks(const struct file_lock *fl1, const struct file_lock *fl2) 242 const struct file_lock *fl2)
241{ 243{
242 return fl1->fl_pid == fl2->fl_pid 244 return fl1->fl_pid == fl2->fl_pid
243 && fl1->fl_owner == fl2->fl_owner 245 && fl1->fl_owner == fl2->fl_owner
diff --git a/include/linux/lockd/sm_inter.h b/include/linux/lockd/sm_inter.h
index 22a645828f26..5a5448bdb17d 100644
--- a/include/linux/lockd/sm_inter.h
+++ b/include/linux/lockd/sm_inter.h
@@ -19,6 +19,7 @@
19#define SM_NOTIFY 6 19#define SM_NOTIFY 6
20 20
21#define SM_MAXSTRLEN 1024 21#define SM_MAXSTRLEN 1024
22#define SM_PRIV_SIZE 16
22 23
23/* 24/*
24 * Arguments for all calls to statd 25 * Arguments for all calls to statd
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index f4a0e4c218df..27d6a8d98cef 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -430,7 +430,6 @@ extern void nfs_unregister_sysctl(void);
430/* 430/*
431 * linux/fs/nfs/namespace.c 431 * linux/fs/nfs/namespace.c
432 */ 432 */
433extern struct list_head nfs_automount_list;
434extern const struct inode_operations nfs_mountpoint_inode_operations; 433extern const struct inode_operations nfs_mountpoint_inode_operations;
435extern const struct inode_operations nfs_referral_inode_operations; 434extern const struct inode_operations nfs_referral_inode_operations;
436extern int nfs_mountpoint_expiry_timeout; 435extern int nfs_mountpoint_expiry_timeout;
@@ -466,9 +465,9 @@ extern int nfs_wb_page(struct inode *inode, struct page* page);
466extern int nfs_wb_page_cancel(struct inode *inode, struct page* page); 465extern int nfs_wb_page_cancel(struct inode *inode, struct page* page);
467#if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) 466#if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4)
468extern int nfs_commit_inode(struct inode *, int); 467extern int nfs_commit_inode(struct inode *, int);
469extern struct nfs_write_data *nfs_commit_alloc(void); 468extern struct nfs_write_data *nfs_commitdata_alloc(void);
470extern void nfs_commit_free(struct nfs_write_data *wdata); 469extern void nfs_commit_free(struct nfs_write_data *wdata);
471extern void nfs_commit_release(void *wdata); 470extern void nfs_commitdata_release(void *wdata);
472#else 471#else
473static inline int 472static inline int
474nfs_commit_inode(struct inode *inode, int how) 473nfs_commit_inode(struct inode *inode, int how)
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h
index 3423c6761bf7..c9beacd16c00 100644
--- a/include/linux/nfs_fs_sb.h
+++ b/include/linux/nfs_fs_sb.h
@@ -32,6 +32,8 @@ struct nfs_client {
32 const struct nfs_rpc_ops *rpc_ops; /* NFS protocol vector */ 32 const struct nfs_rpc_ops *rpc_ops; /* NFS protocol vector */
33 int cl_proto; /* Network transport protocol */ 33 int cl_proto; /* Network transport protocol */
34 34
35 struct rpc_cred *cl_machine_cred;
36
35#ifdef CONFIG_NFS_V4 37#ifdef CONFIG_NFS_V4
36 u64 cl_clientid; /* constant */ 38 u64 cl_clientid; /* constant */
37 nfs4_verifier cl_confirm; 39 nfs4_verifier cl_confirm;
@@ -93,6 +95,7 @@ struct nfs_server {
93 unsigned int wpages; /* write size (in pages) */ 95 unsigned int wpages; /* write size (in pages) */
94 unsigned int wtmult; /* server disk block size */ 96 unsigned int wtmult; /* server disk block size */
95 unsigned int dtsize; /* readdir size */ 97 unsigned int dtsize; /* readdir size */
98 unsigned short port; /* "port=" setting */
96 unsigned int bsize; /* server block size */ 99 unsigned int bsize; /* server block size */
97 unsigned int acregmin; /* attr cache timeouts */ 100 unsigned int acregmin; /* attr cache timeouts */
98 unsigned int acregmax; 101 unsigned int acregmax;
@@ -117,6 +120,13 @@ struct nfs_server {
117 120
118 atomic_t active; /* Keep trace of any activity to this server */ 121 atomic_t active; /* Keep trace of any activity to this server */
119 wait_queue_head_t active_wq; /* Wait for any activity to stop */ 122 wait_queue_head_t active_wq; /* Wait for any activity to stop */
123
124 /* mountd-related mount options */
125 struct sockaddr_storage mountd_address;
126 size_t mountd_addrlen;
127 u32 mountd_version;
128 unsigned short mountd_port;
129 unsigned short mountd_protocol;
120}; 130};
121 131
122/* Server capabilities */ 132/* Server capabilities */
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index f301d0b8babc..24263bb8e0be 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -140,6 +140,7 @@ struct nfs_openres {
140 __u32 rflags; 140 __u32 rflags;
141 struct nfs_fattr * f_attr; 141 struct nfs_fattr * f_attr;
142 struct nfs_fattr * dir_attr; 142 struct nfs_fattr * dir_attr;
143 struct nfs_seqid * seqid;
143 const struct nfs_server *server; 144 const struct nfs_server *server;
144 int delegation_type; 145 int delegation_type;
145 nfs4_stateid delegation; 146 nfs4_stateid delegation;
@@ -159,6 +160,7 @@ struct nfs_open_confirmargs {
159 160
160struct nfs_open_confirmres { 161struct nfs_open_confirmres {
161 nfs4_stateid stateid; 162 nfs4_stateid stateid;
163 struct nfs_seqid * seqid;
162}; 164};
163 165
164/* 166/*
@@ -175,6 +177,7 @@ struct nfs_closeargs {
175struct nfs_closeres { 177struct nfs_closeres {
176 nfs4_stateid stateid; 178 nfs4_stateid stateid;
177 struct nfs_fattr * fattr; 179 struct nfs_fattr * fattr;
180 struct nfs_seqid * seqid;
178 const struct nfs_server *server; 181 const struct nfs_server *server;
179}; 182};
180/* 183/*
@@ -199,7 +202,9 @@ struct nfs_lock_args {
199}; 202};
200 203
201struct nfs_lock_res { 204struct nfs_lock_res {
202 nfs4_stateid stateid; 205 nfs4_stateid stateid;
206 struct nfs_seqid * lock_seqid;
207 struct nfs_seqid * open_seqid;
203}; 208};
204 209
205struct nfs_locku_args { 210struct nfs_locku_args {
@@ -210,7 +215,8 @@ struct nfs_locku_args {
210}; 215};
211 216
212struct nfs_locku_res { 217struct nfs_locku_res {
213 nfs4_stateid stateid; 218 nfs4_stateid stateid;
219 struct nfs_seqid * seqid;
214}; 220};
215 221
216struct nfs_lockt_args { 222struct nfs_lockt_args {
diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h
index 7a69ca3bebaf..3f632182d8eb 100644
--- a/include/linux/sunrpc/auth.h
+++ b/include/linux/sunrpc/auth.h
@@ -26,6 +26,7 @@ struct auth_cred {
26 uid_t uid; 26 uid_t uid;
27 gid_t gid; 27 gid_t gid;
28 struct group_info *group_info; 28 struct group_info *group_info;
29 unsigned char machine_cred : 1;
29}; 30};
30 31
31/* 32/*
@@ -59,8 +60,8 @@ struct rpc_cred {
59/* 60/*
60 * Client authentication handle 61 * Client authentication handle
61 */ 62 */
62#define RPC_CREDCACHE_NR 8 63#define RPC_CREDCACHE_HASHBITS 4
63#define RPC_CREDCACHE_MASK (RPC_CREDCACHE_NR - 1) 64#define RPC_CREDCACHE_NR (1 << RPC_CREDCACHE_HASHBITS)
64struct rpc_cred_cache { 65struct rpc_cred_cache {
65 struct hlist_head hashtable[RPC_CREDCACHE_NR]; 66 struct hlist_head hashtable[RPC_CREDCACHE_NR];
66 spinlock_t lock; 67 spinlock_t lock;
@@ -89,7 +90,6 @@ struct rpc_auth {
89 90
90/* Flags for rpcauth_lookupcred() */ 91/* Flags for rpcauth_lookupcred() */
91#define RPCAUTH_LOOKUP_NEW 0x01 /* Accept an uninitialised cred */ 92#define RPCAUTH_LOOKUP_NEW 0x01 /* Accept an uninitialised cred */
92#define RPCAUTH_LOOKUP_ROOTCREDS 0x02 /* This really ought to go! */
93 93
94/* 94/*
95 * Client authentication ops 95 * Client authentication ops
@@ -97,9 +97,7 @@ struct rpc_auth {
97struct rpc_authops { 97struct rpc_authops {
98 struct module *owner; 98 struct module *owner;
99 rpc_authflavor_t au_flavor; /* flavor (RPC_AUTH_*) */ 99 rpc_authflavor_t au_flavor; /* flavor (RPC_AUTH_*) */
100#ifdef RPC_DEBUG
101 char * au_name; 100 char * au_name;
102#endif
103 struct rpc_auth * (*create)(struct rpc_clnt *, rpc_authflavor_t); 101 struct rpc_auth * (*create)(struct rpc_clnt *, rpc_authflavor_t);
104 void (*destroy)(struct rpc_auth *); 102 void (*destroy)(struct rpc_auth *);
105 103
@@ -113,6 +111,7 @@ struct rpc_credops {
113 void (*crdestroy)(struct rpc_cred *); 111 void (*crdestroy)(struct rpc_cred *);
114 112
115 int (*crmatch)(struct auth_cred *, struct rpc_cred *, int); 113 int (*crmatch)(struct auth_cred *, struct rpc_cred *, int);
114 void (*crbind)(struct rpc_task *, struct rpc_cred *);
116 __be32 * (*crmarshal)(struct rpc_task *, __be32 *); 115 __be32 * (*crmarshal)(struct rpc_task *, __be32 *);
117 int (*crrefresh)(struct rpc_task *); 116 int (*crrefresh)(struct rpc_task *);
118 __be32 * (*crvalidate)(struct rpc_task *, __be32 *); 117 __be32 * (*crvalidate)(struct rpc_task *, __be32 *);
@@ -126,9 +125,13 @@ extern const struct rpc_authops authunix_ops;
126extern const struct rpc_authops authnull_ops; 125extern const struct rpc_authops authnull_ops;
127 126
128void __init rpc_init_authunix(void); 127void __init rpc_init_authunix(void);
128void __init rpc_init_generic_auth(void);
129void __init rpcauth_init_module(void); 129void __init rpcauth_init_module(void);
130void __exit rpcauth_remove_module(void); 130void __exit rpcauth_remove_module(void);
131void __exit rpc_destroy_generic_auth(void);
131 132
133struct rpc_cred * rpc_lookup_cred(void);
134struct rpc_cred * rpc_lookup_machine_cred(void);
132int rpcauth_register(const struct rpc_authops *); 135int rpcauth_register(const struct rpc_authops *);
133int rpcauth_unregister(const struct rpc_authops *); 136int rpcauth_unregister(const struct rpc_authops *);
134struct rpc_auth * rpcauth_create(rpc_authflavor_t, struct rpc_clnt *); 137struct rpc_auth * rpcauth_create(rpc_authflavor_t, struct rpc_clnt *);
@@ -136,8 +139,8 @@ void rpcauth_release(struct rpc_auth *);
136struct rpc_cred * rpcauth_lookup_credcache(struct rpc_auth *, struct auth_cred *, int); 139struct rpc_cred * rpcauth_lookup_credcache(struct rpc_auth *, struct auth_cred *, int);
137void rpcauth_init_cred(struct rpc_cred *, const struct auth_cred *, struct rpc_auth *, const struct rpc_credops *); 140void rpcauth_init_cred(struct rpc_cred *, const struct auth_cred *, struct rpc_auth *, const struct rpc_credops *);
138struct rpc_cred * rpcauth_lookupcred(struct rpc_auth *, int); 141struct rpc_cred * rpcauth_lookupcred(struct rpc_auth *, int);
139struct rpc_cred * rpcauth_bindcred(struct rpc_task *); 142void rpcauth_bindcred(struct rpc_task *, struct rpc_cred *, int);
140void rpcauth_holdcred(struct rpc_task *); 143void rpcauth_generic_bind_cred(struct rpc_task *, struct rpc_cred *);
141void put_rpccred(struct rpc_cred *); 144void put_rpccred(struct rpc_cred *);
142void rpcauth_unbindcred(struct rpc_task *); 145void rpcauth_unbindcred(struct rpc_task *);
143__be32 * rpcauth_marshcred(struct rpc_task *, __be32 *); 146__be32 * rpcauth_marshcred(struct rpc_task *, __be32 *);
diff --git a/include/linux/sunrpc/auth_gss.h b/include/linux/sunrpc/auth_gss.h
index 67658e17a375..fec6899bf355 100644
--- a/include/linux/sunrpc/auth_gss.h
+++ b/include/linux/sunrpc/auth_gss.h
@@ -84,6 +84,7 @@ struct gss_cred {
84 enum rpc_gss_svc gc_service; 84 enum rpc_gss_svc gc_service;
85 struct gss_cl_ctx *gc_ctx; 85 struct gss_cl_ctx *gc_ctx;
86 struct gss_upcall_msg *gc_upcall; 86 struct gss_upcall_msg *gc_upcall;
87 unsigned char gc_machine_cred : 1;
87}; 88};
88 89
89#endif /* __KERNEL__ */ 90#endif /* __KERNEL__ */
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h
index 129a86e25d29..6fff7f82ef12 100644
--- a/include/linux/sunrpc/clnt.h
+++ b/include/linux/sunrpc/clnt.h
@@ -127,11 +127,12 @@ int rpcb_getport_sync(struct sockaddr_in *, u32, u32, int);
127void rpcb_getport_async(struct rpc_task *); 127void rpcb_getport_async(struct rpc_task *);
128 128
129void rpc_call_start(struct rpc_task *); 129void rpc_call_start(struct rpc_task *);
130int rpc_call_async(struct rpc_clnt *clnt, struct rpc_message *msg, 130int rpc_call_async(struct rpc_clnt *clnt,
131 int flags, const struct rpc_call_ops *tk_ops, 131 const struct rpc_message *msg, int flags,
132 const struct rpc_call_ops *tk_ops,
132 void *calldata); 133 void *calldata);
133int rpc_call_sync(struct rpc_clnt *clnt, struct rpc_message *msg, 134int rpc_call_sync(struct rpc_clnt *clnt,
134 int flags); 135 const struct rpc_message *msg, int flags);
135struct rpc_task *rpc_call_null(struct rpc_clnt *clnt, struct rpc_cred *cred, 136struct rpc_task *rpc_call_null(struct rpc_clnt *clnt, struct rpc_cred *cred,
136 int flags); 137 int flags);
137void rpc_restart_call(struct rpc_task *); 138void rpc_restart_call(struct rpc_task *);
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h
index f689f02e6793..d1a5c8c1a0f1 100644
--- a/include/linux/sunrpc/sched.h
+++ b/include/linux/sunrpc/sched.h
@@ -11,7 +11,6 @@
11 11
12#include <linux/timer.h> 12#include <linux/timer.h>
13#include <linux/sunrpc/types.h> 13#include <linux/sunrpc/types.h>
14#include <linux/rcupdate.h>
15#include <linux/spinlock.h> 14#include <linux/spinlock.h>
16#include <linux/wait.h> 15#include <linux/wait.h>
17#include <linux/workqueue.h> 16#include <linux/workqueue.h>
@@ -33,7 +32,8 @@ struct rpc_wait_queue;
33struct rpc_wait { 32struct rpc_wait {
34 struct list_head list; /* wait queue links */ 33 struct list_head list; /* wait queue links */
35 struct list_head links; /* Links to related tasks */ 34 struct list_head links; /* Links to related tasks */
36 struct rpc_wait_queue * rpc_waitq; /* RPC wait queue we're on */ 35 struct list_head timer_list; /* Timer list */
36 unsigned long expires;
37}; 37};
38 38
39/* 39/*
@@ -57,33 +57,25 @@ struct rpc_task {
57 __u8 tk_cred_retry; 57 __u8 tk_cred_retry;
58 58
59 /* 59 /*
60 * timeout_fn to be executed by timer bottom half
61 * callback to be executed after waking up 60 * callback to be executed after waking up
62 * action next procedure for async tasks 61 * action next procedure for async tasks
63 * tk_ops caller callbacks 62 * tk_ops caller callbacks
64 */ 63 */
65 void (*tk_timeout_fn)(struct rpc_task *);
66 void (*tk_callback)(struct rpc_task *); 64 void (*tk_callback)(struct rpc_task *);
67 void (*tk_action)(struct rpc_task *); 65 void (*tk_action)(struct rpc_task *);
68 const struct rpc_call_ops *tk_ops; 66 const struct rpc_call_ops *tk_ops;
69 void * tk_calldata; 67 void * tk_calldata;
70 68
71 /*
72 * tk_timer is used for async processing by the RPC scheduling
73 * primitives. You should not access this directly unless
74 * you have a pathological interest in kernel oopses.
75 */
76 struct timer_list tk_timer; /* kernel timer */
77 unsigned long tk_timeout; /* timeout for rpc_sleep() */ 69 unsigned long tk_timeout; /* timeout for rpc_sleep() */
78 unsigned short tk_flags; /* misc flags */ 70 unsigned short tk_flags; /* misc flags */
79 unsigned long tk_runstate; /* Task run status */ 71 unsigned long tk_runstate; /* Task run status */
80 struct workqueue_struct *tk_workqueue; /* Normally rpciod, but could 72 struct workqueue_struct *tk_workqueue; /* Normally rpciod, but could
81 * be any workqueue 73 * be any workqueue
82 */ 74 */
75 struct rpc_wait_queue *tk_waitqueue; /* RPC wait queue we're on */
83 union { 76 union {
84 struct work_struct tk_work; /* Async task work queue */ 77 struct work_struct tk_work; /* Async task work queue */
85 struct rpc_wait tk_wait; /* RPC wait */ 78 struct rpc_wait tk_wait; /* RPC wait */
86 struct rcu_head tk_rcu; /* for task deletion */
87 } u; 79 } u;
88 80
89 unsigned short tk_timeouts; /* maj timeouts */ 81 unsigned short tk_timeouts; /* maj timeouts */
@@ -123,6 +115,7 @@ struct rpc_task_setup {
123 const struct rpc_message *rpc_message; 115 const struct rpc_message *rpc_message;
124 const struct rpc_call_ops *callback_ops; 116 const struct rpc_call_ops *callback_ops;
125 void *callback_data; 117 void *callback_data;
118 struct workqueue_struct *workqueue;
126 unsigned short flags; 119 unsigned short flags;
127 signed char priority; 120 signed char priority;
128}; 121};
@@ -147,9 +140,7 @@ struct rpc_task_setup {
147 140
148#define RPC_TASK_RUNNING 0 141#define RPC_TASK_RUNNING 0
149#define RPC_TASK_QUEUED 1 142#define RPC_TASK_QUEUED 1
150#define RPC_TASK_WAKEUP 2 143#define RPC_TASK_ACTIVE 2
151#define RPC_TASK_HAS_TIMER 3
152#define RPC_TASK_ACTIVE 4
153 144
154#define RPC_IS_RUNNING(t) test_bit(RPC_TASK_RUNNING, &(t)->tk_runstate) 145#define RPC_IS_RUNNING(t) test_bit(RPC_TASK_RUNNING, &(t)->tk_runstate)
155#define rpc_set_running(t) set_bit(RPC_TASK_RUNNING, &(t)->tk_runstate) 146#define rpc_set_running(t) set_bit(RPC_TASK_RUNNING, &(t)->tk_runstate)
@@ -171,15 +162,6 @@ struct rpc_task_setup {
171 smp_mb__after_clear_bit(); \ 162 smp_mb__after_clear_bit(); \
172 } while (0) 163 } while (0)
173 164
174#define rpc_start_wakeup(t) \
175 (test_and_set_bit(RPC_TASK_WAKEUP, &(t)->tk_runstate) == 0)
176#define rpc_finish_wakeup(t) \
177 do { \
178 smp_mb__before_clear_bit(); \
179 clear_bit(RPC_TASK_WAKEUP, &(t)->tk_runstate); \
180 smp_mb__after_clear_bit(); \
181 } while (0)
182
183#define RPC_IS_ACTIVATED(t) test_bit(RPC_TASK_ACTIVE, &(t)->tk_runstate) 165#define RPC_IS_ACTIVATED(t) test_bit(RPC_TASK_ACTIVE, &(t)->tk_runstate)
184 166
185/* 167/*
@@ -192,6 +174,12 @@ struct rpc_task_setup {
192#define RPC_PRIORITY_HIGH (1) 174#define RPC_PRIORITY_HIGH (1)
193#define RPC_NR_PRIORITY (1 + RPC_PRIORITY_HIGH - RPC_PRIORITY_LOW) 175#define RPC_NR_PRIORITY (1 + RPC_PRIORITY_HIGH - RPC_PRIORITY_LOW)
194 176
177struct rpc_timer {
178 struct timer_list timer;
179 struct list_head list;
180 unsigned long expires;
181};
182
195/* 183/*
196 * RPC synchronization objects 184 * RPC synchronization objects
197 */ 185 */
@@ -204,6 +192,7 @@ struct rpc_wait_queue {
204 unsigned char count; /* # task groups remaining serviced so far */ 192 unsigned char count; /* # task groups remaining serviced so far */
205 unsigned char nr; /* # tasks remaining for cookie */ 193 unsigned char nr; /* # tasks remaining for cookie */
206 unsigned short qlen; /* total # tasks waiting in queue */ 194 unsigned short qlen; /* total # tasks waiting in queue */
195 struct rpc_timer timer_list;
207#ifdef RPC_DEBUG 196#ifdef RPC_DEBUG
208 const char * name; 197 const char * name;
209#endif 198#endif
@@ -229,9 +218,11 @@ void rpc_killall_tasks(struct rpc_clnt *);
229void rpc_execute(struct rpc_task *); 218void rpc_execute(struct rpc_task *);
230void rpc_init_priority_wait_queue(struct rpc_wait_queue *, const char *); 219void rpc_init_priority_wait_queue(struct rpc_wait_queue *, const char *);
231void rpc_init_wait_queue(struct rpc_wait_queue *, const char *); 220void rpc_init_wait_queue(struct rpc_wait_queue *, const char *);
221void rpc_destroy_wait_queue(struct rpc_wait_queue *);
232void rpc_sleep_on(struct rpc_wait_queue *, struct rpc_task *, 222void rpc_sleep_on(struct rpc_wait_queue *, struct rpc_task *,
233 rpc_action action, rpc_action timer); 223 rpc_action action);
234void rpc_wake_up_task(struct rpc_task *); 224void rpc_wake_up_queued_task(struct rpc_wait_queue *,
225 struct rpc_task *);
235void rpc_wake_up(struct rpc_wait_queue *); 226void rpc_wake_up(struct rpc_wait_queue *);
236struct rpc_task *rpc_wake_up_next(struct rpc_wait_queue *); 227struct rpc_task *rpc_wake_up_next(struct rpc_wait_queue *);
237void rpc_wake_up_status(struct rpc_wait_queue *, int); 228void rpc_wake_up_status(struct rpc_wait_queue *, int);
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h
index b3ff9a815e6f..4d80a118d538 100644
--- a/include/linux/sunrpc/xprt.h
+++ b/include/linux/sunrpc/xprt.h
@@ -86,6 +86,10 @@ struct rpc_rqst {
86 unsigned long rq_majortimeo; /* major timeout alarm */ 86 unsigned long rq_majortimeo; /* major timeout alarm */
87 unsigned long rq_timeout; /* Current timeout value */ 87 unsigned long rq_timeout; /* Current timeout value */
88 unsigned int rq_retries; /* # of retries */ 88 unsigned int rq_retries; /* # of retries */
89 unsigned int rq_connect_cookie;
90 /* A cookie used to track the
91 state of the transport
92 connection */
89 93
90 /* 94 /*
91 * Partial send handling 95 * Partial send handling
@@ -152,6 +156,9 @@ struct rpc_xprt {
152 unsigned long connect_timeout, 156 unsigned long connect_timeout,
153 bind_timeout, 157 bind_timeout,
154 reestablish_timeout; 158 reestablish_timeout;
159 unsigned int connect_cookie; /* A cookie that gets bumped
160 every time the transport
161 is reconnected */
155 162
156 /* 163 /*
157 * Disconnection of idle transports 164 * Disconnection of idle transports
@@ -232,7 +239,7 @@ int xprt_unregister_transport(struct xprt_class *type);
232void xprt_set_retrans_timeout_def(struct rpc_task *task); 239void xprt_set_retrans_timeout_def(struct rpc_task *task);
233void xprt_set_retrans_timeout_rtt(struct rpc_task *task); 240void xprt_set_retrans_timeout_rtt(struct rpc_task *task);
234void xprt_wake_pending_tasks(struct rpc_xprt *xprt, int status); 241void xprt_wake_pending_tasks(struct rpc_xprt *xprt, int status);
235void xprt_wait_for_buffer_space(struct rpc_task *task); 242void xprt_wait_for_buffer_space(struct rpc_task *task, rpc_action action);
236void xprt_write_space(struct rpc_xprt *xprt); 243void xprt_write_space(struct rpc_xprt *xprt);
237void xprt_update_rtt(struct rpc_task *task); 244void xprt_update_rtt(struct rpc_task *task);
238void xprt_adjust_cwnd(struct rpc_task *task, int result); 245void xprt_adjust_cwnd(struct rpc_task *task, int result);
@@ -241,6 +248,7 @@ void xprt_complete_rqst(struct rpc_task *task, int copied);
241void xprt_release_rqst_cong(struct rpc_task *task); 248void xprt_release_rqst_cong(struct rpc_task *task);
242void xprt_disconnect_done(struct rpc_xprt *xprt); 249void xprt_disconnect_done(struct rpc_xprt *xprt);
243void xprt_force_disconnect(struct rpc_xprt *xprt); 250void xprt_force_disconnect(struct rpc_xprt *xprt);
251void xprt_conditional_disconnect(struct rpc_xprt *xprt, unsigned int cookie);
244 252
245/* 253/*
246 * Reserved bit positions in xprt->state 254 * Reserved bit positions in xprt->state