diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/sunrpc/auth.h | 13 | ||||
-rw-r--r-- | include/linux/sunrpc/clnt.h | 9 | ||||
-rw-r--r-- | include/linux/sunrpc/sched.h | 41 |
3 files changed, 29 insertions, 34 deletions
diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h index 7a69ca3bebaf..e93cd8aa3eb6 100644 --- a/include/linux/sunrpc/auth.h +++ b/include/linux/sunrpc/auth.h | |||
@@ -59,8 +59,8 @@ struct rpc_cred { | |||
59 | /* | 59 | /* |
60 | * Client authentication handle | 60 | * Client authentication handle |
61 | */ | 61 | */ |
62 | #define RPC_CREDCACHE_NR 8 | 62 | #define RPC_CREDCACHE_HASHBITS 4 |
63 | #define RPC_CREDCACHE_MASK (RPC_CREDCACHE_NR - 1) | 63 | #define RPC_CREDCACHE_NR (1 << RPC_CREDCACHE_HASHBITS) |
64 | struct rpc_cred_cache { | 64 | struct rpc_cred_cache { |
65 | struct hlist_head hashtable[RPC_CREDCACHE_NR]; | 65 | struct hlist_head hashtable[RPC_CREDCACHE_NR]; |
66 | spinlock_t lock; | 66 | spinlock_t lock; |
@@ -89,7 +89,6 @@ struct rpc_auth { | |||
89 | 89 | ||
90 | /* Flags for rpcauth_lookupcred() */ | 90 | /* Flags for rpcauth_lookupcred() */ |
91 | #define RPCAUTH_LOOKUP_NEW 0x01 /* Accept an uninitialised cred */ | 91 | #define RPCAUTH_LOOKUP_NEW 0x01 /* Accept an uninitialised cred */ |
92 | #define RPCAUTH_LOOKUP_ROOTCREDS 0x02 /* This really ought to go! */ | ||
93 | 92 | ||
94 | /* | 93 | /* |
95 | * Client authentication ops | 94 | * Client authentication ops |
@@ -113,6 +112,7 @@ struct rpc_credops { | |||
113 | void (*crdestroy)(struct rpc_cred *); | 112 | void (*crdestroy)(struct rpc_cred *); |
114 | 113 | ||
115 | int (*crmatch)(struct auth_cred *, struct rpc_cred *, int); | 114 | int (*crmatch)(struct auth_cred *, struct rpc_cred *, int); |
115 | void (*crbind)(struct rpc_task *, struct rpc_cred *); | ||
116 | __be32 * (*crmarshal)(struct rpc_task *, __be32 *); | 116 | __be32 * (*crmarshal)(struct rpc_task *, __be32 *); |
117 | int (*crrefresh)(struct rpc_task *); | 117 | int (*crrefresh)(struct rpc_task *); |
118 | __be32 * (*crvalidate)(struct rpc_task *, __be32 *); | 118 | __be32 * (*crvalidate)(struct rpc_task *, __be32 *); |
@@ -126,9 +126,12 @@ extern const struct rpc_authops authunix_ops; | |||
126 | extern const struct rpc_authops authnull_ops; | 126 | extern const struct rpc_authops authnull_ops; |
127 | 127 | ||
128 | void __init rpc_init_authunix(void); | 128 | void __init rpc_init_authunix(void); |
129 | void __init rpc_init_generic_auth(void); | ||
129 | void __init rpcauth_init_module(void); | 130 | void __init rpcauth_init_module(void); |
130 | void __exit rpcauth_remove_module(void); | 131 | void __exit rpcauth_remove_module(void); |
132 | void __exit rpc_destroy_generic_auth(void); | ||
131 | 133 | ||
134 | struct rpc_cred * rpc_lookup_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/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); |