aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/sunrpc
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-01-11 18:11:56 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2011-01-11 18:11:56 -0500
commitb9d919a4ac6cf031b8e065f82ad8f1b0c9ed74b1 (patch)
tree3139b066396956fd3794df0cb1aa74dcc9f1cb28 /include/linux/sunrpc
parent7c955fca3e1d8132982148267d9efcafae849bb6 (diff)
parent357f54d6b38252737116a6d631f6ac28ded018ed (diff)
Merge branch 'nfs-for-2.6.38' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6
* 'nfs-for-2.6.38' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6: (89 commits) NFS fix the setting of exchange id flag NFS: Don't use vm_map_ram() in readdir NFSv4: Ensure continued open and lockowner name uniqueness NFS: Move cl_delegations to the nfs_server struct NFS: Introduce nfs_detach_delegations() NFS: Move cl_state_owners and related fields to the nfs_server struct NFS: Allow walking nfs_client.cl_superblocks list outside client.c pnfs: layout roc code pnfs: update nfs4_callback_recallany to handle layouts pnfs: add CB_LAYOUTRECALL handling pnfs: CB_LAYOUTRECALL xdr code pnfs: change lo refcounting to atomic_t pnfs: check that partial LAYOUTGET return is ignored pnfs: add layout to client list before sending rpc pnfs: serialize LAYOUTGET(openstateid) pnfs: layoutget rpc code cleanup pnfs: change how lsegs are removed from layout list pnfs: change layout state seqlock to a spinlock pnfs: add prefix to struct pnfs_layout_hdr fields pnfs: add prefix to struct pnfs_layout_segment fields ...
Diffstat (limited to 'include/linux/sunrpc')
-rw-r--r--include/linux/sunrpc/auth.h8
-rw-r--r--include/linux/sunrpc/bc_xprt.h15
-rw-r--r--include/linux/sunrpc/clnt.h4
-rw-r--r--include/linux/sunrpc/svc.h2
-rw-r--r--include/linux/sunrpc/svc_xprt.h1
-rw-r--r--include/linux/sunrpc/xdr.h14
6 files changed, 33 insertions, 11 deletions
diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h
index b2024757edd5..8521067ed4f7 100644
--- a/include/linux/sunrpc/auth.h
+++ b/include/linux/sunrpc/auth.h
@@ -110,9 +110,9 @@ struct rpc_credops {
110 __be32 * (*crmarshal)(struct rpc_task *, __be32 *); 110 __be32 * (*crmarshal)(struct rpc_task *, __be32 *);
111 int (*crrefresh)(struct rpc_task *); 111 int (*crrefresh)(struct rpc_task *);
112 __be32 * (*crvalidate)(struct rpc_task *, __be32 *); 112 __be32 * (*crvalidate)(struct rpc_task *, __be32 *);
113 int (*crwrap_req)(struct rpc_task *, kxdrproc_t, 113 int (*crwrap_req)(struct rpc_task *, kxdreproc_t,
114 void *, __be32 *, void *); 114 void *, __be32 *, void *);
115 int (*crunwrap_resp)(struct rpc_task *, kxdrproc_t, 115 int (*crunwrap_resp)(struct rpc_task *, kxdrdproc_t,
116 void *, __be32 *, void *); 116 void *, __be32 *, void *);
117}; 117};
118 118
@@ -139,8 +139,8 @@ struct rpc_cred * rpcauth_generic_bind_cred(struct rpc_task *, struct rpc_cred *
139void put_rpccred(struct rpc_cred *); 139void put_rpccred(struct rpc_cred *);
140__be32 * rpcauth_marshcred(struct rpc_task *, __be32 *); 140__be32 * rpcauth_marshcred(struct rpc_task *, __be32 *);
141__be32 * rpcauth_checkverf(struct rpc_task *, __be32 *); 141__be32 * rpcauth_checkverf(struct rpc_task *, __be32 *);
142int rpcauth_wrap_req(struct rpc_task *task, kxdrproc_t encode, void *rqstp, __be32 *data, void *obj); 142int rpcauth_wrap_req(struct rpc_task *task, kxdreproc_t encode, void *rqstp, __be32 *data, void *obj);
143int rpcauth_unwrap_resp(struct rpc_task *task, kxdrproc_t decode, void *rqstp, __be32 *data, void *obj); 143int rpcauth_unwrap_resp(struct rpc_task *task, kxdrdproc_t decode, void *rqstp, __be32 *data, void *obj);
144int rpcauth_refreshcred(struct rpc_task *); 144int rpcauth_refreshcred(struct rpc_task *);
145void rpcauth_invalcred(struct rpc_task *); 145void rpcauth_invalcred(struct rpc_task *);
146int rpcauth_uptodatecred(struct rpc_task *); 146int rpcauth_uptodatecred(struct rpc_task *);
diff --git a/include/linux/sunrpc/bc_xprt.h b/include/linux/sunrpc/bc_xprt.h
index 7c91260c44a9..c50b458b8a3f 100644
--- a/include/linux/sunrpc/bc_xprt.h
+++ b/include/linux/sunrpc/bc_xprt.h
@@ -43,10 +43,18 @@ int bc_send(struct rpc_rqst *req);
43 */ 43 */
44static inline int svc_is_backchannel(const struct svc_rqst *rqstp) 44static inline int svc_is_backchannel(const struct svc_rqst *rqstp)
45{ 45{
46 if (rqstp->rq_server->bc_xprt) 46 if (rqstp->rq_server->sv_bc_xprt)
47 return 1; 47 return 1;
48 return 0; 48 return 0;
49} 49}
50static inline struct nfs4_sessionid *bc_xprt_sid(struct svc_rqst *rqstp)
51{
52 if (svc_is_backchannel(rqstp))
53 return (struct nfs4_sessionid *)
54 rqstp->rq_server->sv_bc_xprt->xpt_bc_sid;
55 return NULL;
56}
57
50#else /* CONFIG_NFS_V4_1 */ 58#else /* CONFIG_NFS_V4_1 */
51static inline int xprt_setup_backchannel(struct rpc_xprt *xprt, 59static inline int xprt_setup_backchannel(struct rpc_xprt *xprt,
52 unsigned int min_reqs) 60 unsigned int min_reqs)
@@ -59,6 +67,11 @@ static inline int svc_is_backchannel(const struct svc_rqst *rqstp)
59 return 0; 67 return 0;
60} 68}
61 69
70static inline struct nfs4_sessionid *bc_xprt_sid(struct svc_rqst *rqstp)
71{
72 return NULL;
73}
74
62static inline void xprt_free_bc_request(struct rpc_rqst *req) 75static inline void xprt_free_bc_request(struct rpc_rqst *req)
63{ 76{
64} 77}
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h
index a5a55f284b7d..ef9476a36ff7 100644
--- a/include/linux/sunrpc/clnt.h
+++ b/include/linux/sunrpc/clnt.h
@@ -89,8 +89,8 @@ struct rpc_version {
89 */ 89 */
90struct rpc_procinfo { 90struct rpc_procinfo {
91 u32 p_proc; /* RPC procedure number */ 91 u32 p_proc; /* RPC procedure number */
92 kxdrproc_t p_encode; /* XDR encode function */ 92 kxdreproc_t p_encode; /* XDR encode function */
93 kxdrproc_t p_decode; /* XDR decode function */ 93 kxdrdproc_t p_decode; /* XDR decode function */
94 unsigned int p_arglen; /* argument hdr length (u32) */ 94 unsigned int p_arglen; /* argument hdr length (u32) */
95 unsigned int p_replen; /* reply hdr length (u32) */ 95 unsigned int p_replen; /* reply hdr length (u32) */
96 unsigned int p_count; /* call count */ 96 unsigned int p_count; /* call count */
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
index 5a3085b9b394..c81d4d8be3a9 100644
--- a/include/linux/sunrpc/svc.h
+++ b/include/linux/sunrpc/svc.h
@@ -99,7 +99,7 @@ struct svc_serv {
99 spinlock_t sv_cb_lock; /* protects the svc_cb_list */ 99 spinlock_t sv_cb_lock; /* protects the svc_cb_list */
100 wait_queue_head_t sv_cb_waitq; /* sleep here if there are no 100 wait_queue_head_t sv_cb_waitq; /* sleep here if there are no
101 * entries in the svc_cb_list */ 101 * entries in the svc_cb_list */
102 struct svc_xprt *bc_xprt; 102 struct svc_xprt *sv_bc_xprt; /* callback on fore channel */
103#endif /* CONFIG_NFS_V4_1 */ 103#endif /* CONFIG_NFS_V4_1 */
104}; 104};
105 105
diff --git a/include/linux/sunrpc/svc_xprt.h b/include/linux/sunrpc/svc_xprt.h
index aea0d438e3c7..357da5e0daa3 100644
--- a/include/linux/sunrpc/svc_xprt.h
+++ b/include/linux/sunrpc/svc_xprt.h
@@ -78,6 +78,7 @@ struct svc_xprt {
78 size_t xpt_remotelen; /* length of address */ 78 size_t xpt_remotelen; /* length of address */
79 struct rpc_wait_queue xpt_bc_pending; /* backchannel wait queue */ 79 struct rpc_wait_queue xpt_bc_pending; /* backchannel wait queue */
80 struct list_head xpt_users; /* callbacks on free */ 80 struct list_head xpt_users; /* callbacks on free */
81 void *xpt_bc_sid; /* back channel session ID */
81 82
82 struct net *xpt_net; 83 struct net *xpt_net;
83}; 84};
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h
index 498ab93a81e4..fc84b7a19ca3 100644
--- a/include/linux/sunrpc/xdr.h
+++ b/include/linux/sunrpc/xdr.h
@@ -33,8 +33,8 @@ struct xdr_netobj {
33}; 33};
34 34
35/* 35/*
36 * This is the generic XDR function. rqstp is either a rpc_rqst (client 36 * This is the legacy generic XDR function. rqstp is either a rpc_rqst
37 * side) or svc_rqst pointer (server side). 37 * (client side) or svc_rqst pointer (server side).
38 * Encode functions always assume there's enough room in the buffer. 38 * Encode functions always assume there's enough room in the buffer.
39 */ 39 */
40typedef int (*kxdrproc_t)(void *rqstp, __be32 *data, void *obj); 40typedef int (*kxdrproc_t)(void *rqstp, __be32 *data, void *obj);
@@ -201,14 +201,22 @@ struct xdr_stream {
201 201
202 __be32 *end; /* end of available buffer space */ 202 __be32 *end; /* end of available buffer space */
203 struct kvec *iov; /* pointer to the current kvec */ 203 struct kvec *iov; /* pointer to the current kvec */
204 struct kvec scratch; /* Scratch buffer */
205 struct page **page_ptr; /* pointer to the current page */
204}; 206};
205 207
208/*
209 * These are the xdr_stream style generic XDR encode and decode functions.
210 */
211typedef void (*kxdreproc_t)(void *rqstp, struct xdr_stream *xdr, void *obj);
212typedef int (*kxdrdproc_t)(void *rqstp, struct xdr_stream *xdr, void *obj);
213
206extern void xdr_init_encode(struct xdr_stream *xdr, struct xdr_buf *buf, __be32 *p); 214extern void xdr_init_encode(struct xdr_stream *xdr, struct xdr_buf *buf, __be32 *p);
207extern __be32 *xdr_reserve_space(struct xdr_stream *xdr, size_t nbytes); 215extern __be32 *xdr_reserve_space(struct xdr_stream *xdr, size_t nbytes);
208extern void xdr_write_pages(struct xdr_stream *xdr, struct page **pages, 216extern void xdr_write_pages(struct xdr_stream *xdr, struct page **pages,
209 unsigned int base, unsigned int len); 217 unsigned int base, unsigned int len);
210extern void xdr_init_decode(struct xdr_stream *xdr, struct xdr_buf *buf, __be32 *p); 218extern void xdr_init_decode(struct xdr_stream *xdr, struct xdr_buf *buf, __be32 *p);
211extern __be32 *xdr_inline_peek(struct xdr_stream *xdr, size_t nbytes); 219extern void xdr_set_scratch_buffer(struct xdr_stream *xdr, void *buf, size_t buflen);
212extern __be32 *xdr_inline_decode(struct xdr_stream *xdr, size_t nbytes); 220extern __be32 *xdr_inline_decode(struct xdr_stream *xdr, size_t nbytes);
213extern void xdr_read_pages(struct xdr_stream *xdr, unsigned int len); 221extern void xdr_read_pages(struct xdr_stream *xdr, unsigned int len);
214extern void xdr_enter_page(struct xdr_stream *xdr, unsigned int len); 222extern void xdr_enter_page(struct xdr_stream *xdr, unsigned int len);