diff options
Diffstat (limited to 'include/linux/sunrpc')
-rw-r--r-- | include/linux/sunrpc/clnt.h | 5 | ||||
-rw-r--r-- | include/linux/sunrpc/gss_spkm3.h | 2 | ||||
-rw-r--r-- | include/linux/sunrpc/sched.h | 48 | ||||
-rw-r--r-- | include/linux/sunrpc/xdr.h | 6 | ||||
-rw-r--r-- | include/linux/sunrpc/xprt.h | 12 |
5 files changed, 48 insertions, 25 deletions
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h index ab151bbb66df..f147e6b84332 100644 --- a/include/linux/sunrpc/clnt.h +++ b/include/linux/sunrpc/clnt.h | |||
@@ -49,7 +49,6 @@ struct rpc_clnt { | |||
49 | 49 | ||
50 | unsigned int cl_softrtry : 1,/* soft timeouts */ | 50 | unsigned int cl_softrtry : 1,/* soft timeouts */ |
51 | cl_intr : 1,/* interruptible */ | 51 | cl_intr : 1,/* interruptible */ |
52 | cl_chatty : 1,/* be verbose */ | ||
53 | cl_autobind : 1,/* use getport() */ | 52 | cl_autobind : 1,/* use getport() */ |
54 | cl_oneshot : 1,/* dispose after use */ | 53 | cl_oneshot : 1,/* dispose after use */ |
55 | cl_dead : 1;/* abandoned */ | 54 | cl_dead : 1;/* abandoned */ |
@@ -126,7 +125,8 @@ int rpc_register(u32, u32, int, unsigned short, int *); | |||
126 | void rpc_call_setup(struct rpc_task *, struct rpc_message *, int); | 125 | void rpc_call_setup(struct rpc_task *, struct rpc_message *, int); |
127 | 126 | ||
128 | int rpc_call_async(struct rpc_clnt *clnt, struct rpc_message *msg, | 127 | int rpc_call_async(struct rpc_clnt *clnt, struct rpc_message *msg, |
129 | int flags, rpc_action callback, void *clntdata); | 128 | int flags, const struct rpc_call_ops *tk_ops, |
129 | void *calldata); | ||
130 | int rpc_call_sync(struct rpc_clnt *clnt, struct rpc_message *msg, | 130 | int rpc_call_sync(struct rpc_clnt *clnt, struct rpc_message *msg, |
131 | int flags); | 131 | int flags); |
132 | void rpc_restart_call(struct rpc_task *); | 132 | void rpc_restart_call(struct rpc_task *); |
@@ -134,6 +134,7 @@ void rpc_clnt_sigmask(struct rpc_clnt *clnt, sigset_t *oldset); | |||
134 | void rpc_clnt_sigunmask(struct rpc_clnt *clnt, sigset_t *oldset); | 134 | void rpc_clnt_sigunmask(struct rpc_clnt *clnt, sigset_t *oldset); |
135 | void rpc_setbufsize(struct rpc_clnt *, unsigned int, unsigned int); | 135 | void rpc_setbufsize(struct rpc_clnt *, unsigned int, unsigned int); |
136 | size_t rpc_max_payload(struct rpc_clnt *); | 136 | size_t rpc_max_payload(struct rpc_clnt *); |
137 | void rpc_force_rebind(struct rpc_clnt *); | ||
137 | int rpc_ping(struct rpc_clnt *clnt, int flags); | 138 | int rpc_ping(struct rpc_clnt *clnt, int flags); |
138 | 139 | ||
139 | static __inline__ | 140 | static __inline__ |
diff --git a/include/linux/sunrpc/gss_spkm3.h b/include/linux/sunrpc/gss_spkm3.h index 0beb2cf00a84..336e218c2782 100644 --- a/include/linux/sunrpc/gss_spkm3.h +++ b/include/linux/sunrpc/gss_spkm3.h | |||
@@ -48,7 +48,7 @@ u32 spkm3_read_token(struct spkm3_ctx *ctx, struct xdr_netobj *read_token, struc | |||
48 | #define CKSUMTYPE_RSA_MD5 0x0007 | 48 | #define CKSUMTYPE_RSA_MD5 0x0007 |
49 | 49 | ||
50 | s32 make_checksum(s32 cksumtype, char *header, int hdrlen, struct xdr_buf *body, | 50 | s32 make_checksum(s32 cksumtype, char *header, int hdrlen, struct xdr_buf *body, |
51 | struct xdr_netobj *cksum); | 51 | int body_offset, struct xdr_netobj *cksum); |
52 | void asn1_bitstring_len(struct xdr_netobj *in, int *enclen, int *zerobits); | 52 | void asn1_bitstring_len(struct xdr_netobj *in, int *enclen, int *zerobits); |
53 | int decode_asn1_bitstring(struct xdr_netobj *out, char *in, int enclen, | 53 | int decode_asn1_bitstring(struct xdr_netobj *out, char *in, int enclen, |
54 | int explen); | 54 | int explen); |
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h index 4d77e90d0b30..8b25629accd8 100644 --- a/include/linux/sunrpc/sched.h +++ b/include/linux/sunrpc/sched.h | |||
@@ -27,6 +27,7 @@ struct rpc_message { | |||
27 | struct rpc_cred * rpc_cred; /* Credentials */ | 27 | struct rpc_cred * rpc_cred; /* Credentials */ |
28 | }; | 28 | }; |
29 | 29 | ||
30 | struct rpc_call_ops; | ||
30 | struct rpc_wait_queue; | 31 | struct rpc_wait_queue; |
31 | struct rpc_wait { | 32 | struct rpc_wait { |
32 | struct list_head list; /* wait queue links */ | 33 | struct list_head list; /* wait queue links */ |
@@ -41,6 +42,7 @@ struct rpc_task { | |||
41 | #ifdef RPC_DEBUG | 42 | #ifdef RPC_DEBUG |
42 | unsigned long tk_magic; /* 0xf00baa */ | 43 | unsigned long tk_magic; /* 0xf00baa */ |
43 | #endif | 44 | #endif |
45 | atomic_t tk_count; /* Reference count */ | ||
44 | struct list_head tk_task; /* global list of tasks */ | 46 | struct list_head tk_task; /* global list of tasks */ |
45 | struct rpc_clnt * tk_client; /* RPC client */ | 47 | struct rpc_clnt * tk_client; /* RPC client */ |
46 | struct rpc_rqst * tk_rqstp; /* RPC request */ | 48 | struct rpc_rqst * tk_rqstp; /* RPC request */ |
@@ -50,8 +52,6 @@ struct rpc_task { | |||
50 | * RPC call state | 52 | * RPC call state |
51 | */ | 53 | */ |
52 | struct rpc_message tk_msg; /* RPC call info */ | 54 | struct rpc_message tk_msg; /* RPC call info */ |
53 | __u32 * tk_buffer; /* XDR buffer */ | ||
54 | size_t tk_bufsize; | ||
55 | __u8 tk_garb_retry; | 55 | __u8 tk_garb_retry; |
56 | __u8 tk_cred_retry; | 56 | __u8 tk_cred_retry; |
57 | 57 | ||
@@ -61,13 +61,12 @@ struct rpc_task { | |||
61 | * timeout_fn to be executed by timer bottom half | 61 | * timeout_fn to be executed by timer bottom half |
62 | * callback to be executed after waking up | 62 | * callback to be executed after waking up |
63 | * action next procedure for async tasks | 63 | * action next procedure for async tasks |
64 | * exit exit async task and report to caller | 64 | * tk_ops caller callbacks |
65 | */ | 65 | */ |
66 | void (*tk_timeout_fn)(struct rpc_task *); | 66 | void (*tk_timeout_fn)(struct rpc_task *); |
67 | void (*tk_callback)(struct rpc_task *); | 67 | void (*tk_callback)(struct rpc_task *); |
68 | void (*tk_action)(struct rpc_task *); | 68 | void (*tk_action)(struct rpc_task *); |
69 | void (*tk_exit)(struct rpc_task *); | 69 | const struct rpc_call_ops *tk_ops; |
70 | void (*tk_release)(struct rpc_task *); | ||
71 | void * tk_calldata; | 70 | void * tk_calldata; |
72 | 71 | ||
73 | /* | 72 | /* |
@@ -78,7 +77,6 @@ struct rpc_task { | |||
78 | struct timer_list tk_timer; /* kernel timer */ | 77 | struct timer_list tk_timer; /* kernel timer */ |
79 | unsigned long tk_timeout; /* timeout for rpc_sleep() */ | 78 | unsigned long tk_timeout; /* timeout for rpc_sleep() */ |
80 | unsigned short tk_flags; /* misc flags */ | 79 | unsigned short tk_flags; /* misc flags */ |
81 | unsigned char tk_active : 1;/* Task has been activated */ | ||
82 | unsigned char tk_priority : 2;/* Task priority */ | 80 | unsigned char tk_priority : 2;/* Task priority */ |
83 | unsigned long tk_runstate; /* Task run status */ | 81 | unsigned long tk_runstate; /* Task run status */ |
84 | struct workqueue_struct *tk_workqueue; /* Normally rpciod, but could | 82 | struct workqueue_struct *tk_workqueue; /* Normally rpciod, but could |
@@ -111,6 +109,13 @@ struct rpc_task { | |||
111 | 109 | ||
112 | typedef void (*rpc_action)(struct rpc_task *); | 110 | typedef void (*rpc_action)(struct rpc_task *); |
113 | 111 | ||
112 | struct rpc_call_ops { | ||
113 | void (*rpc_call_prepare)(struct rpc_task *, void *); | ||
114 | void (*rpc_call_done)(struct rpc_task *, void *); | ||
115 | void (*rpc_release)(void *); | ||
116 | }; | ||
117 | |||
118 | |||
114 | /* | 119 | /* |
115 | * RPC task flags | 120 | * RPC task flags |
116 | */ | 121 | */ |
@@ -129,7 +134,6 @@ typedef void (*rpc_action)(struct rpc_task *); | |||
129 | #define RPC_IS_SWAPPER(t) ((t)->tk_flags & RPC_TASK_SWAPPER) | 134 | #define RPC_IS_SWAPPER(t) ((t)->tk_flags & RPC_TASK_SWAPPER) |
130 | #define RPC_DO_ROOTOVERRIDE(t) ((t)->tk_flags & RPC_TASK_ROOTCREDS) | 135 | #define RPC_DO_ROOTOVERRIDE(t) ((t)->tk_flags & RPC_TASK_ROOTCREDS) |
131 | #define RPC_ASSASSINATED(t) ((t)->tk_flags & RPC_TASK_KILLED) | 136 | #define RPC_ASSASSINATED(t) ((t)->tk_flags & RPC_TASK_KILLED) |
132 | #define RPC_IS_ACTIVATED(t) ((t)->tk_active) | ||
133 | #define RPC_DO_CALLBACK(t) ((t)->tk_callback != NULL) | 137 | #define RPC_DO_CALLBACK(t) ((t)->tk_callback != NULL) |
134 | #define RPC_IS_SOFT(t) ((t)->tk_flags & RPC_TASK_SOFT) | 138 | #define RPC_IS_SOFT(t) ((t)->tk_flags & RPC_TASK_SOFT) |
135 | #define RPC_TASK_UNINTERRUPTIBLE(t) ((t)->tk_flags & RPC_TASK_NOINTR) | 139 | #define RPC_TASK_UNINTERRUPTIBLE(t) ((t)->tk_flags & RPC_TASK_NOINTR) |
@@ -138,6 +142,7 @@ typedef void (*rpc_action)(struct rpc_task *); | |||
138 | #define RPC_TASK_QUEUED 1 | 142 | #define RPC_TASK_QUEUED 1 |
139 | #define RPC_TASK_WAKEUP 2 | 143 | #define RPC_TASK_WAKEUP 2 |
140 | #define RPC_TASK_HAS_TIMER 3 | 144 | #define RPC_TASK_HAS_TIMER 3 |
145 | #define RPC_TASK_ACTIVE 4 | ||
141 | 146 | ||
142 | #define RPC_IS_RUNNING(t) (test_bit(RPC_TASK_RUNNING, &(t)->tk_runstate)) | 147 | #define RPC_IS_RUNNING(t) (test_bit(RPC_TASK_RUNNING, &(t)->tk_runstate)) |
143 | #define rpc_set_running(t) (set_bit(RPC_TASK_RUNNING, &(t)->tk_runstate)) | 148 | #define rpc_set_running(t) (set_bit(RPC_TASK_RUNNING, &(t)->tk_runstate)) |
@@ -168,6 +173,15 @@ typedef void (*rpc_action)(struct rpc_task *); | |||
168 | smp_mb__after_clear_bit(); \ | 173 | smp_mb__after_clear_bit(); \ |
169 | } while (0) | 174 | } while (0) |
170 | 175 | ||
176 | #define RPC_IS_ACTIVATED(t) (test_bit(RPC_TASK_ACTIVE, &(t)->tk_runstate)) | ||
177 | #define rpc_set_active(t) (set_bit(RPC_TASK_ACTIVE, &(t)->tk_runstate)) | ||
178 | #define rpc_clear_active(t) \ | ||
179 | do { \ | ||
180 | smp_mb__before_clear_bit(); \ | ||
181 | clear_bit(RPC_TASK_ACTIVE, &(t)->tk_runstate); \ | ||
182 | smp_mb__after_clear_bit(); \ | ||
183 | } while(0) | ||
184 | |||
171 | /* | 185 | /* |
172 | * Task priorities. | 186 | * Task priorities. |
173 | * Note: if you change these, you must also change | 187 | * Note: if you change these, you must also change |
@@ -228,11 +242,16 @@ struct rpc_wait_queue { | |||
228 | /* | 242 | /* |
229 | * Function prototypes | 243 | * Function prototypes |
230 | */ | 244 | */ |
231 | struct rpc_task *rpc_new_task(struct rpc_clnt *, rpc_action, int flags); | 245 | struct rpc_task *rpc_new_task(struct rpc_clnt *, int flags, |
246 | const struct rpc_call_ops *ops, void *data); | ||
247 | struct rpc_task *rpc_run_task(struct rpc_clnt *clnt, int flags, | ||
248 | const struct rpc_call_ops *ops, void *data); | ||
232 | struct rpc_task *rpc_new_child(struct rpc_clnt *, struct rpc_task *parent); | 249 | struct rpc_task *rpc_new_child(struct rpc_clnt *, struct rpc_task *parent); |
233 | void rpc_init_task(struct rpc_task *, struct rpc_clnt *, | 250 | void rpc_init_task(struct rpc_task *task, struct rpc_clnt *clnt, |
234 | rpc_action exitfunc, int flags); | 251 | int flags, const struct rpc_call_ops *ops, |
252 | void *data); | ||
235 | void rpc_release_task(struct rpc_task *); | 253 | void rpc_release_task(struct rpc_task *); |
254 | void rpc_exit_task(struct rpc_task *); | ||
236 | void rpc_killall_tasks(struct rpc_clnt *); | 255 | void rpc_killall_tasks(struct rpc_clnt *); |
237 | int rpc_execute(struct rpc_task *); | 256 | int rpc_execute(struct rpc_task *); |
238 | void rpc_run_child(struct rpc_task *parent, struct rpc_task *child, | 257 | void rpc_run_child(struct rpc_task *parent, struct rpc_task *child, |
@@ -247,9 +266,11 @@ struct rpc_task *rpc_wake_up_next(struct rpc_wait_queue *); | |||
247 | void rpc_wake_up_status(struct rpc_wait_queue *, int); | 266 | void rpc_wake_up_status(struct rpc_wait_queue *, int); |
248 | void rpc_delay(struct rpc_task *, unsigned long); | 267 | void rpc_delay(struct rpc_task *, unsigned long); |
249 | void * rpc_malloc(struct rpc_task *, size_t); | 268 | void * rpc_malloc(struct rpc_task *, size_t); |
269 | void rpc_free(struct rpc_task *); | ||
250 | int rpciod_up(void); | 270 | int rpciod_up(void); |
251 | void rpciod_down(void); | 271 | void rpciod_down(void); |
252 | void rpciod_wake_up(void); | 272 | void rpciod_wake_up(void); |
273 | int __rpc_wait_for_completion_task(struct rpc_task *task, int (*)(void *)); | ||
253 | #ifdef RPC_DEBUG | 274 | #ifdef RPC_DEBUG |
254 | void rpc_show_tasks(void); | 275 | void rpc_show_tasks(void); |
255 | #endif | 276 | #endif |
@@ -259,7 +280,12 @@ void rpc_destroy_mempool(void); | |||
259 | static inline void rpc_exit(struct rpc_task *task, int status) | 280 | static inline void rpc_exit(struct rpc_task *task, int status) |
260 | { | 281 | { |
261 | task->tk_status = status; | 282 | task->tk_status = status; |
262 | task->tk_action = NULL; | 283 | task->tk_action = rpc_exit_task; |
284 | } | ||
285 | |||
286 | static inline int rpc_wait_for_completion_task(struct rpc_task *task) | ||
287 | { | ||
288 | return __rpc_wait_for_completion_task(task, NULL); | ||
263 | } | 289 | } |
264 | 290 | ||
265 | #ifdef RPC_DEBUG | 291 | #ifdef RPC_DEBUG |
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h index 5da968729cf8..84c35d42d250 100644 --- a/include/linux/sunrpc/xdr.h +++ b/include/linux/sunrpc/xdr.h | |||
@@ -91,7 +91,6 @@ struct xdr_buf { | |||
91 | u32 * xdr_encode_opaque_fixed(u32 *p, const void *ptr, unsigned int len); | 91 | u32 * xdr_encode_opaque_fixed(u32 *p, const void *ptr, unsigned int len); |
92 | u32 * xdr_encode_opaque(u32 *p, const void *ptr, unsigned int len); | 92 | u32 * xdr_encode_opaque(u32 *p, const void *ptr, unsigned int len); |
93 | u32 * xdr_encode_string(u32 *p, const char *s); | 93 | u32 * xdr_encode_string(u32 *p, const char *s); |
94 | u32 * xdr_decode_string(u32 *p, char **sp, int *lenp, int maxlen); | ||
95 | u32 * xdr_decode_string_inplace(u32 *p, char **sp, int *lenp, int maxlen); | 94 | u32 * xdr_decode_string_inplace(u32 *p, char **sp, int *lenp, int maxlen); |
96 | u32 * xdr_encode_netobj(u32 *p, const struct xdr_netobj *); | 95 | u32 * xdr_encode_netobj(u32 *p, const struct xdr_netobj *); |
97 | u32 * xdr_decode_netobj(u32 *p, struct xdr_netobj *); | 96 | u32 * xdr_decode_netobj(u32 *p, struct xdr_netobj *); |
@@ -135,11 +134,6 @@ xdr_adjust_iovec(struct kvec *iov, u32 *p) | |||
135 | } | 134 | } |
136 | 135 | ||
137 | /* | 136 | /* |
138 | * Maximum number of iov's we use. | ||
139 | */ | ||
140 | #define MAX_IOVEC (12) | ||
141 | |||
142 | /* | ||
143 | * XDR buffer helper functions | 137 | * XDR buffer helper functions |
144 | */ | 138 | */ |
145 | extern void xdr_shift_buf(struct xdr_buf *, size_t); | 139 | extern void xdr_shift_buf(struct xdr_buf *, size_t); |
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h index 3b8b6e823c70..6ef99b14ff09 100644 --- a/include/linux/sunrpc/xprt.h +++ b/include/linux/sunrpc/xprt.h | |||
@@ -79,21 +79,19 @@ struct rpc_rqst { | |||
79 | void (*rq_release_snd_buf)(struct rpc_rqst *); /* release rq_enc_pages */ | 79 | void (*rq_release_snd_buf)(struct rpc_rqst *); /* release rq_enc_pages */ |
80 | struct list_head rq_list; | 80 | struct list_head rq_list; |
81 | 81 | ||
82 | __u32 * rq_buffer; /* XDR encode buffer */ | ||
83 | size_t rq_bufsize; | ||
84 | |||
82 | struct xdr_buf rq_private_buf; /* The receive buffer | 85 | struct xdr_buf rq_private_buf; /* The receive buffer |
83 | * used in the softirq. | 86 | * used in the softirq. |
84 | */ | 87 | */ |
85 | unsigned long rq_majortimeo; /* major timeout alarm */ | 88 | unsigned long rq_majortimeo; /* major timeout alarm */ |
86 | unsigned long rq_timeout; /* Current timeout value */ | 89 | unsigned long rq_timeout; /* Current timeout value */ |
87 | unsigned int rq_retries; /* # of retries */ | 90 | unsigned int rq_retries; /* # of retries */ |
88 | /* | ||
89 | * For authentication (e.g. auth_des) | ||
90 | */ | ||
91 | u32 rq_creddata[2]; | ||
92 | 91 | ||
93 | /* | 92 | /* |
94 | * Partial send handling | 93 | * Partial send handling |
95 | */ | 94 | */ |
96 | |||
97 | u32 rq_bytes_sent; /* Bytes we have sent */ | 95 | u32 rq_bytes_sent; /* Bytes we have sent */ |
98 | 96 | ||
99 | unsigned long rq_xtime; /* when transmitted */ | 97 | unsigned long rq_xtime; /* when transmitted */ |
@@ -106,7 +104,10 @@ struct rpc_xprt_ops { | |||
106 | void (*set_buffer_size)(struct rpc_xprt *xprt, size_t sndsize, size_t rcvsize); | 104 | void (*set_buffer_size)(struct rpc_xprt *xprt, size_t sndsize, size_t rcvsize); |
107 | int (*reserve_xprt)(struct rpc_task *task); | 105 | int (*reserve_xprt)(struct rpc_task *task); |
108 | void (*release_xprt)(struct rpc_xprt *xprt, struct rpc_task *task); | 106 | void (*release_xprt)(struct rpc_xprt *xprt, struct rpc_task *task); |
107 | void (*set_port)(struct rpc_xprt *xprt, unsigned short port); | ||
109 | void (*connect)(struct rpc_task *task); | 108 | void (*connect)(struct rpc_task *task); |
109 | void * (*buf_alloc)(struct rpc_task *task, size_t size); | ||
110 | void (*buf_free)(struct rpc_task *task); | ||
110 | int (*send_request)(struct rpc_task *task); | 111 | int (*send_request)(struct rpc_task *task); |
111 | void (*set_retrans_timeout)(struct rpc_task *task); | 112 | void (*set_retrans_timeout)(struct rpc_task *task); |
112 | void (*timer)(struct rpc_task *task); | 113 | void (*timer)(struct rpc_task *task); |
@@ -253,6 +254,7 @@ int xs_setup_tcp(struct rpc_xprt *xprt, struct rpc_timeout *to); | |||
253 | #define XPRT_LOCKED (0) | 254 | #define XPRT_LOCKED (0) |
254 | #define XPRT_CONNECTED (1) | 255 | #define XPRT_CONNECTED (1) |
255 | #define XPRT_CONNECTING (2) | 256 | #define XPRT_CONNECTING (2) |
257 | #define XPRT_CLOSE_WAIT (3) | ||
256 | 258 | ||
257 | static inline void xprt_set_connected(struct rpc_xprt *xprt) | 259 | static inline void xprt_set_connected(struct rpc_xprt *xprt) |
258 | { | 260 | { |