aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/sunrpc
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-04-24 14:46:16 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-24 14:46:16 -0400
commit563307b2fa15d687abc54bd980b9847ebf0e3231 (patch)
tree7f16be30217a2e66360ede97aa27d07a4ebd7e55 /include/linux/sunrpc
parent10c993a6b5418cb1026775765ba4c70ffb70853d (diff)
parent233607dbbc823caf685e778cabc49fb7f679900b (diff)
Merge git://git.linux-nfs.org/projects/trondmy/nfs-2.6
* git://git.linux-nfs.org/projects/trondmy/nfs-2.6: (80 commits) SUNRPC: Invalidate the RPCSEC_GSS session if the server dropped the request make nfs_automount_list static NFS: remove duplicate flags assignment from nfs_validate_mount_data NFS - fix potential NULL pointer dereference v2 SUNRPC: Don't change the RPCSEC_GSS context on a credential that is in use SUNRPC: Fix a race in gss_refresh_upcall() SUNRPC: Don't disconnect more than once if retransmitting NFSv4 requests SUNRPC: Remove the unused export of xprt_force_disconnect SUNRPC: remove XS_SENDMSG_RETRY SUNRPC: Protect creds against early garbage collection NFSv4: Attempt to use machine credentials in SETCLIENTID calls NFSv4: Reintroduce machine creds NFSv4: Don't use cred->cr_ops->cr_name in nfs4_proc_setclientid() nfs: fix printout of multiword bitfields nfs: return negative error value from nfs{,4}_stat_to_errno NLM/lockd: Ensure client locking calls use correct credentials NFS: Remove the buggy lock-if-signalled case from do_setlk() NLM/lockd: Fix a race when cancelling a blocking lock NLM/lockd: Ensure that nlmclnt_cancel() returns results of the CANCEL call NLM: Remove the signal masking in nlmclnt_proc/nlmclnt_cancel ...
Diffstat (limited to 'include/linux/sunrpc')
-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
5 files changed, 41 insertions, 37 deletions
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