diff options
Diffstat (limited to 'include/linux/sunrpc')
-rw-r--r-- | include/linux/sunrpc/auth.h | 17 | ||||
-rw-r--r-- | include/linux/sunrpc/auth_gss.h | 1 | ||||
-rw-r--r-- | include/linux/sunrpc/clnt.h | 9 | ||||
-rw-r--r-- | include/linux/sunrpc/sched.h | 41 | ||||
-rw-r--r-- | include/linux/sunrpc/xprt.h | 10 |
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) |
64 | struct rpc_cred_cache { | 65 | struct 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 { | |||
97 | struct rpc_authops { | 97 | struct 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; | |||
126 | extern const struct rpc_authops authnull_ops; | 125 | extern const struct rpc_authops authnull_ops; |
127 | 126 | ||
128 | void __init rpc_init_authunix(void); | 127 | void __init rpc_init_authunix(void); |
128 | void __init rpc_init_generic_auth(void); | ||
129 | void __init rpcauth_init_module(void); | 129 | void __init rpcauth_init_module(void); |
130 | void __exit rpcauth_remove_module(void); | 130 | void __exit rpcauth_remove_module(void); |
131 | void __exit rpc_destroy_generic_auth(void); | ||
131 | 132 | ||
133 | struct rpc_cred * rpc_lookup_cred(void); | ||
134 | struct rpc_cred * rpc_lookup_machine_cred(void); | ||
132 | int rpcauth_register(const struct rpc_authops *); | 135 | int rpcauth_register(const struct rpc_authops *); |
133 | int rpcauth_unregister(const struct rpc_authops *); | 136 | int rpcauth_unregister(const struct rpc_authops *); |
134 | struct rpc_auth * rpcauth_create(rpc_authflavor_t, struct rpc_clnt *); | 137 | struct rpc_auth * rpcauth_create(rpc_authflavor_t, struct rpc_clnt *); |
@@ -136,8 +139,8 @@ void rpcauth_release(struct rpc_auth *); | |||
136 | struct rpc_cred * rpcauth_lookup_credcache(struct rpc_auth *, struct auth_cred *, int); | 139 | struct rpc_cred * rpcauth_lookup_credcache(struct rpc_auth *, struct auth_cred *, int); |
137 | void rpcauth_init_cred(struct rpc_cred *, const struct auth_cred *, struct rpc_auth *, const struct rpc_credops *); | 140 | void rpcauth_init_cred(struct rpc_cred *, const struct auth_cred *, struct rpc_auth *, const struct rpc_credops *); |
138 | struct rpc_cred * rpcauth_lookupcred(struct rpc_auth *, int); | 141 | struct rpc_cred * rpcauth_lookupcred(struct rpc_auth *, int); |
139 | struct rpc_cred * rpcauth_bindcred(struct rpc_task *); | 142 | void rpcauth_bindcred(struct rpc_task *, struct rpc_cred *, int); |
140 | void rpcauth_holdcred(struct rpc_task *); | 143 | void rpcauth_generic_bind_cred(struct rpc_task *, struct rpc_cred *); |
141 | void put_rpccred(struct rpc_cred *); | 144 | void put_rpccred(struct rpc_cred *); |
142 | void rpcauth_unbindcred(struct rpc_task *); | 145 | void 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); | |||
127 | void rpcb_getport_async(struct rpc_task *); | 127 | void rpcb_getport_async(struct rpc_task *); |
128 | 128 | ||
129 | void rpc_call_start(struct rpc_task *); | 129 | void rpc_call_start(struct rpc_task *); |
130 | int rpc_call_async(struct rpc_clnt *clnt, struct rpc_message *msg, | 130 | int 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); |
133 | int rpc_call_sync(struct rpc_clnt *clnt, struct rpc_message *msg, | 134 | int rpc_call_sync(struct rpc_clnt *clnt, |
134 | int flags); | 135 | const struct rpc_message *msg, int flags); |
135 | struct rpc_task *rpc_call_null(struct rpc_clnt *clnt, struct rpc_cred *cred, | 136 | struct rpc_task *rpc_call_null(struct rpc_clnt *clnt, struct rpc_cred *cred, |
136 | int flags); | 137 | int flags); |
137 | void rpc_restart_call(struct rpc_task *); | 138 | void 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; | |||
33 | struct rpc_wait { | 32 | struct 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 | ||
177 | struct 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 *); | |||
229 | void rpc_execute(struct rpc_task *); | 218 | void rpc_execute(struct rpc_task *); |
230 | void rpc_init_priority_wait_queue(struct rpc_wait_queue *, const char *); | 219 | void rpc_init_priority_wait_queue(struct rpc_wait_queue *, const char *); |
231 | void rpc_init_wait_queue(struct rpc_wait_queue *, const char *); | 220 | void rpc_init_wait_queue(struct rpc_wait_queue *, const char *); |
221 | void rpc_destroy_wait_queue(struct rpc_wait_queue *); | ||
232 | void rpc_sleep_on(struct rpc_wait_queue *, struct rpc_task *, | 222 | void rpc_sleep_on(struct rpc_wait_queue *, struct rpc_task *, |
233 | rpc_action action, rpc_action timer); | 223 | rpc_action action); |
234 | void rpc_wake_up_task(struct rpc_task *); | 224 | void rpc_wake_up_queued_task(struct rpc_wait_queue *, |
225 | struct rpc_task *); | ||
235 | void rpc_wake_up(struct rpc_wait_queue *); | 226 | void rpc_wake_up(struct rpc_wait_queue *); |
236 | struct rpc_task *rpc_wake_up_next(struct rpc_wait_queue *); | 227 | struct rpc_task *rpc_wake_up_next(struct rpc_wait_queue *); |
237 | void rpc_wake_up_status(struct rpc_wait_queue *, int); | 228 | void 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); | |||
232 | void xprt_set_retrans_timeout_def(struct rpc_task *task); | 239 | void xprt_set_retrans_timeout_def(struct rpc_task *task); |
233 | void xprt_set_retrans_timeout_rtt(struct rpc_task *task); | 240 | void xprt_set_retrans_timeout_rtt(struct rpc_task *task); |
234 | void xprt_wake_pending_tasks(struct rpc_xprt *xprt, int status); | 241 | void xprt_wake_pending_tasks(struct rpc_xprt *xprt, int status); |
235 | void xprt_wait_for_buffer_space(struct rpc_task *task); | 242 | void xprt_wait_for_buffer_space(struct rpc_task *task, rpc_action action); |
236 | void xprt_write_space(struct rpc_xprt *xprt); | 243 | void xprt_write_space(struct rpc_xprt *xprt); |
237 | void xprt_update_rtt(struct rpc_task *task); | 244 | void xprt_update_rtt(struct rpc_task *task); |
238 | void xprt_adjust_cwnd(struct rpc_task *task, int result); | 245 | void xprt_adjust_cwnd(struct rpc_task *task, int result); |
@@ -241,6 +248,7 @@ void xprt_complete_rqst(struct rpc_task *task, int copied); | |||
241 | void xprt_release_rqst_cong(struct rpc_task *task); | 248 | void xprt_release_rqst_cong(struct rpc_task *task); |
242 | void xprt_disconnect_done(struct rpc_xprt *xprt); | 249 | void xprt_disconnect_done(struct rpc_xprt *xprt); |
243 | void xprt_force_disconnect(struct rpc_xprt *xprt); | 250 | void xprt_force_disconnect(struct rpc_xprt *xprt); |
251 | void 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 |