diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-22 15:53:06 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-22 15:53:06 -0400 |
commit | df36b439c5fedefe013d4449cb6a50d15e2f4d70 (patch) | |
tree | 537c58db778cbf11b74e28091f89d1b8139fb84d /include/linux/sunrpc | |
parent | a9b011f5ac57cbaedb32a8149f3d39d7b2c1f0e0 (diff) | |
parent | e9f029855865e917821ef6034b31e340a4cfc815 (diff) |
Merge branch 'for-2.6.31' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6
* 'for-2.6.31' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6: (128 commits)
nfs41: sunrpc: xprt_alloc_bc_request() should not use spin_lock_bh()
nfs41: Move initialization of nfs4_opendata seq_res to nfs4_init_opendata_res
nfs: remove unnecessary NFS_INO_INVALID_ACL checks
NFS: More "sloppy" parsing problems
NFS: Invalid mount option values should always fail, even with "sloppy"
NFS: Remove unused XDR decoder functions
NFS: Update MNT and MNT3 reply decoding functions
NFS: add XDR decoder for mountd version 3 auth-flavor lists
NFS: add new file handle decoders to in-kernel mountd client
NFS: Add separate mountd status code decoders for each mountd version
NFS: remove unused function in fs/nfs/mount_clnt.c
NFS: Use xdr_stream-based XDR encoder for MNT's dirpath argument
NFS: Clean up MNT program definitions
lockd: Don't bother with RPC ping for NSM upcalls
lockd: Update NSM state from SM_MON replies
NFS: Fix false error return from nfs_callback_up() if ipv6.ko is not available
NFS: Return error code from nfs_callback_up() to user space
NFS: Do not display the setting of the "intr" mount option
NFS: add support for splice writes
nfs41: Backchannel: CB_SEQUENCE validation
...
Diffstat (limited to 'include/linux/sunrpc')
-rw-r--r-- | include/linux/sunrpc/bc_xprt.h | 49 | ||||
-rw-r--r-- | include/linux/sunrpc/clnt.h | 1 | ||||
-rw-r--r-- | include/linux/sunrpc/sched.h | 3 | ||||
-rw-r--r-- | include/linux/sunrpc/svc.h | 11 | ||||
-rw-r--r-- | include/linux/sunrpc/svcsock.h | 2 | ||||
-rw-r--r-- | include/linux/sunrpc/xprt.h | 38 |
6 files changed, 103 insertions, 1 deletions
diff --git a/include/linux/sunrpc/bc_xprt.h b/include/linux/sunrpc/bc_xprt.h new file mode 100644 index 000000000000..6508f0dc0eff --- /dev/null +++ b/include/linux/sunrpc/bc_xprt.h | |||
@@ -0,0 +1,49 @@ | |||
1 | /****************************************************************************** | ||
2 | |||
3 | (c) 2008 NetApp. All Rights Reserved. | ||
4 | |||
5 | NetApp provides this source code under the GPL v2 License. | ||
6 | The GPL v2 license is available at | ||
7 | http://opensource.org/licenses/gpl-license.php. | ||
8 | |||
9 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
10 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
11 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
12 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR | ||
13 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | ||
14 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | ||
15 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | ||
16 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | ||
17 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING | ||
18 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
19 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
20 | |||
21 | ******************************************************************************/ | ||
22 | |||
23 | /* | ||
24 | * Functions to create and manage the backchannel | ||
25 | */ | ||
26 | |||
27 | #ifndef _LINUX_SUNRPC_BC_XPRT_H | ||
28 | #define _LINUX_SUNRPC_BC_XPRT_H | ||
29 | |||
30 | #include <linux/sunrpc/svcsock.h> | ||
31 | #include <linux/sunrpc/xprt.h> | ||
32 | #include <linux/sunrpc/sched.h> | ||
33 | |||
34 | #ifdef CONFIG_NFS_V4_1 | ||
35 | struct rpc_rqst *xprt_alloc_bc_request(struct rpc_xprt *xprt); | ||
36 | void xprt_free_bc_request(struct rpc_rqst *req); | ||
37 | int xprt_setup_backchannel(struct rpc_xprt *, unsigned int min_reqs); | ||
38 | void xprt_destroy_backchannel(struct rpc_xprt *, int max_reqs); | ||
39 | void bc_release_request(struct rpc_task *); | ||
40 | int bc_send(struct rpc_rqst *req); | ||
41 | #else /* CONFIG_NFS_V4_1 */ | ||
42 | static inline int xprt_setup_backchannel(struct rpc_xprt *xprt, | ||
43 | unsigned int min_reqs) | ||
44 | { | ||
45 | return 0; | ||
46 | } | ||
47 | #endif /* CONFIG_NFS_V4_1 */ | ||
48 | #endif /* _LINUX_SUNRPC_BC_XPRT_H */ | ||
49 | |||
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h index c39a21040dcb..37881f1a0bd7 100644 --- a/include/linux/sunrpc/clnt.h +++ b/include/linux/sunrpc/clnt.h | |||
@@ -143,6 +143,7 @@ int rpc_call_sync(struct rpc_clnt *clnt, | |||
143 | const struct rpc_message *msg, int flags); | 143 | const struct rpc_message *msg, int flags); |
144 | struct rpc_task *rpc_call_null(struct rpc_clnt *clnt, struct rpc_cred *cred, | 144 | struct rpc_task *rpc_call_null(struct rpc_clnt *clnt, struct rpc_cred *cred, |
145 | int flags); | 145 | int flags); |
146 | void rpc_restart_call_prepare(struct rpc_task *); | ||
146 | void rpc_restart_call(struct rpc_task *); | 147 | void rpc_restart_call(struct rpc_task *); |
147 | void rpc_setbufsize(struct rpc_clnt *, unsigned int, unsigned int); | 148 | void rpc_setbufsize(struct rpc_clnt *, unsigned int, unsigned int); |
148 | size_t rpc_max_payload(struct rpc_clnt *); | 149 | size_t rpc_max_payload(struct rpc_clnt *); |
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h index 64981a2f1cae..401097781fc0 100644 --- a/include/linux/sunrpc/sched.h +++ b/include/linux/sunrpc/sched.h | |||
@@ -210,6 +210,8 @@ struct rpc_wait_queue { | |||
210 | */ | 210 | */ |
211 | struct rpc_task *rpc_new_task(const struct rpc_task_setup *); | 211 | struct rpc_task *rpc_new_task(const struct rpc_task_setup *); |
212 | struct rpc_task *rpc_run_task(const struct rpc_task_setup *); | 212 | struct rpc_task *rpc_run_task(const struct rpc_task_setup *); |
213 | struct rpc_task *rpc_run_bc_task(struct rpc_rqst *req, | ||
214 | const struct rpc_call_ops *ops); | ||
213 | void rpc_put_task(struct rpc_task *); | 215 | void rpc_put_task(struct rpc_task *); |
214 | void rpc_exit_task(struct rpc_task *); | 216 | void rpc_exit_task(struct rpc_task *); |
215 | void rpc_release_calldata(const struct rpc_call_ops *, void *); | 217 | void rpc_release_calldata(const struct rpc_call_ops *, void *); |
@@ -237,6 +239,7 @@ void rpc_show_tasks(void); | |||
237 | int rpc_init_mempool(void); | 239 | int rpc_init_mempool(void); |
238 | void rpc_destroy_mempool(void); | 240 | void rpc_destroy_mempool(void); |
239 | extern struct workqueue_struct *rpciod_workqueue; | 241 | extern struct workqueue_struct *rpciod_workqueue; |
242 | void rpc_prepare_task(struct rpc_task *task); | ||
240 | 243 | ||
241 | static inline void rpc_exit(struct rpc_task *task, int status) | 244 | static inline void rpc_exit(struct rpc_task *task, int status) |
242 | { | 245 | { |
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index 2a30775959e9..ea8009695c69 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h | |||
@@ -96,6 +96,15 @@ struct svc_serv { | |||
96 | svc_thread_fn sv_function; /* main function for threads */ | 96 | svc_thread_fn sv_function; /* main function for threads */ |
97 | unsigned int sv_drc_max_pages; /* Total pages for DRC */ | 97 | unsigned int sv_drc_max_pages; /* Total pages for DRC */ |
98 | unsigned int sv_drc_pages_used;/* DRC pages used */ | 98 | unsigned int sv_drc_pages_used;/* DRC pages used */ |
99 | #if defined(CONFIG_NFS_V4_1) | ||
100 | struct list_head sv_cb_list; /* queue for callback requests | ||
101 | * that arrive over the same | ||
102 | * connection */ | ||
103 | spinlock_t sv_cb_lock; /* protects the svc_cb_list */ | ||
104 | wait_queue_head_t sv_cb_waitq; /* sleep here if there are no | ||
105 | * entries in the svc_cb_list */ | ||
106 | struct svc_xprt *bc_xprt; | ||
107 | #endif /* CONFIG_NFS_V4_1 */ | ||
99 | }; | 108 | }; |
100 | 109 | ||
101 | /* | 110 | /* |
@@ -411,6 +420,8 @@ int svc_set_num_threads(struct svc_serv *, struct svc_pool *, int); | |||
411 | int svc_pool_stats_open(struct svc_serv *serv, struct file *file); | 420 | int svc_pool_stats_open(struct svc_serv *serv, struct file *file); |
412 | void svc_destroy(struct svc_serv *); | 421 | void svc_destroy(struct svc_serv *); |
413 | int svc_process(struct svc_rqst *); | 422 | int svc_process(struct svc_rqst *); |
423 | int bc_svc_process(struct svc_serv *, struct rpc_rqst *, | ||
424 | struct svc_rqst *); | ||
414 | int svc_register(const struct svc_serv *, const int, | 425 | int svc_register(const struct svc_serv *, const int, |
415 | const unsigned short, const unsigned short); | 426 | const unsigned short, const unsigned short); |
416 | 427 | ||
diff --git a/include/linux/sunrpc/svcsock.h b/include/linux/sunrpc/svcsock.h index 483e10380aae..6bb1ec4ae310 100644 --- a/include/linux/sunrpc/svcsock.h +++ b/include/linux/sunrpc/svcsock.h | |||
@@ -42,6 +42,8 @@ int svc_sock_names(char *buf, struct svc_serv *serv, char *toclose); | |||
42 | int svc_addsock(struct svc_serv *serv, int fd, char *name_return); | 42 | int svc_addsock(struct svc_serv *serv, int fd, char *name_return); |
43 | void svc_init_xprt_sock(void); | 43 | void svc_init_xprt_sock(void); |
44 | void svc_cleanup_xprt_sock(void); | 44 | void svc_cleanup_xprt_sock(void); |
45 | struct svc_xprt *svc_sock_create(struct svc_serv *serv, int prot); | ||
46 | void svc_sock_destroy(struct svc_xprt *); | ||
45 | 47 | ||
46 | /* | 48 | /* |
47 | * svc_makesock socket characteristics | 49 | * svc_makesock socket characteristics |
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h index 08afe43118f4..1175d58efc2e 100644 --- a/include/linux/sunrpc/xprt.h +++ b/include/linux/sunrpc/xprt.h | |||
@@ -67,7 +67,8 @@ struct rpc_rqst { | |||
67 | struct rpc_task * rq_task; /* RPC task data */ | 67 | struct rpc_task * rq_task; /* RPC task data */ |
68 | __be32 rq_xid; /* request XID */ | 68 | __be32 rq_xid; /* request XID */ |
69 | int rq_cong; /* has incremented xprt->cong */ | 69 | int rq_cong; /* has incremented xprt->cong */ |
70 | int rq_received; /* receive completed */ | 70 | int rq_reply_bytes_recvd; /* number of reply */ |
71 | /* bytes received */ | ||
71 | u32 rq_seqno; /* gss seq no. used on req. */ | 72 | u32 rq_seqno; /* gss seq no. used on req. */ |
72 | int rq_enc_pages_num; | 73 | int rq_enc_pages_num; |
73 | struct page **rq_enc_pages; /* scratch pages for use by | 74 | struct page **rq_enc_pages; /* scratch pages for use by |
@@ -97,6 +98,12 @@ struct rpc_rqst { | |||
97 | 98 | ||
98 | unsigned long rq_xtime; /* when transmitted */ | 99 | unsigned long rq_xtime; /* when transmitted */ |
99 | int rq_ntrans; | 100 | int rq_ntrans; |
101 | |||
102 | #if defined(CONFIG_NFS_V4_1) | ||
103 | struct list_head rq_bc_list; /* Callback service list */ | ||
104 | unsigned long rq_bc_pa_state; /* Backchannel prealloc state */ | ||
105 | struct list_head rq_bc_pa_list; /* Backchannel prealloc list */ | ||
106 | #endif /* CONFIG_NFS_V4_1 */ | ||
100 | }; | 107 | }; |
101 | #define rq_svec rq_snd_buf.head | 108 | #define rq_svec rq_snd_buf.head |
102 | #define rq_slen rq_snd_buf.len | 109 | #define rq_slen rq_snd_buf.len |
@@ -174,6 +181,15 @@ struct rpc_xprt { | |||
174 | spinlock_t reserve_lock; /* lock slot table */ | 181 | spinlock_t reserve_lock; /* lock slot table */ |
175 | u32 xid; /* Next XID value to use */ | 182 | u32 xid; /* Next XID value to use */ |
176 | struct rpc_task * snd_task; /* Task blocked in send */ | 183 | struct rpc_task * snd_task; /* Task blocked in send */ |
184 | #if defined(CONFIG_NFS_V4_1) | ||
185 | struct svc_serv *bc_serv; /* The RPC service which will */ | ||
186 | /* process the callback */ | ||
187 | unsigned int bc_alloc_count; /* Total number of preallocs */ | ||
188 | spinlock_t bc_pa_lock; /* Protects the preallocated | ||
189 | * items */ | ||
190 | struct list_head bc_pa_list; /* List of preallocated | ||
191 | * backchannel rpc_rqst's */ | ||
192 | #endif /* CONFIG_NFS_V4_1 */ | ||
177 | struct list_head recv; | 193 | struct list_head recv; |
178 | 194 | ||
179 | struct { | 195 | struct { |
@@ -192,6 +208,26 @@ struct rpc_xprt { | |||
192 | const char *address_strings[RPC_DISPLAY_MAX]; | 208 | const char *address_strings[RPC_DISPLAY_MAX]; |
193 | }; | 209 | }; |
194 | 210 | ||
211 | #if defined(CONFIG_NFS_V4_1) | ||
212 | /* | ||
213 | * Backchannel flags | ||
214 | */ | ||
215 | #define RPC_BC_PA_IN_USE 0x0001 /* Preallocated backchannel */ | ||
216 | /* buffer in use */ | ||
217 | #endif /* CONFIG_NFS_V4_1 */ | ||
218 | |||
219 | #if defined(CONFIG_NFS_V4_1) | ||
220 | static inline int bc_prealloc(struct rpc_rqst *req) | ||
221 | { | ||
222 | return test_bit(RPC_BC_PA_IN_USE, &req->rq_bc_pa_state); | ||
223 | } | ||
224 | #else | ||
225 | static inline int bc_prealloc(struct rpc_rqst *req) | ||
226 | { | ||
227 | return 0; | ||
228 | } | ||
229 | #endif /* CONFIG_NFS_V4_1 */ | ||
230 | |||
195 | struct xprt_create { | 231 | struct xprt_create { |
196 | int ident; /* XPRT_TRANSPORT identifier */ | 232 | int ident; /* XPRT_TRANSPORT identifier */ |
197 | struct sockaddr * srcaddr; /* optional local address */ | 233 | struct sockaddr * srcaddr; /* optional local address */ |