diff options
Diffstat (limited to 'include/linux/sunrpc')
| -rw-r--r-- | include/linux/sunrpc/auth.h | 8 | ||||
| -rw-r--r-- | include/linux/sunrpc/bc_xprt.h | 2 | ||||
| -rw-r--r-- | include/linux/sunrpc/cache.h | 4 | ||||
| -rw-r--r-- | include/linux/sunrpc/clnt.h | 4 | ||||
| -rw-r--r-- | include/linux/sunrpc/svc.h | 3 | ||||
| -rw-r--r-- | include/linux/sunrpc/svc_xprt.h | 20 | ||||
| -rw-r--r-- | include/linux/sunrpc/svcsock.h | 1 | ||||
| -rw-r--r-- | include/linux/sunrpc/xdr.h | 14 | ||||
| -rw-r--r-- | include/linux/sunrpc/xprt.h | 1 |
9 files changed, 40 insertions, 17 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 * | |||
| 139 | void put_rpccred(struct rpc_cred *); | 139 | void 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 *); |
| 142 | int rpcauth_wrap_req(struct rpc_task *task, kxdrproc_t encode, void *rqstp, __be32 *data, void *obj); | 142 | int rpcauth_wrap_req(struct rpc_task *task, kxdreproc_t encode, void *rqstp, __be32 *data, void *obj); |
| 143 | int rpcauth_unwrap_resp(struct rpc_task *task, kxdrproc_t decode, void *rqstp, __be32 *data, void *obj); | 143 | int rpcauth_unwrap_resp(struct rpc_task *task, kxdrdproc_t decode, void *rqstp, __be32 *data, void *obj); |
| 144 | int rpcauth_refreshcred(struct rpc_task *); | 144 | int rpcauth_refreshcred(struct rpc_task *); |
| 145 | void rpcauth_invalcred(struct rpc_task *); | 145 | void rpcauth_invalcred(struct rpc_task *); |
| 146 | int rpcauth_uptodatecred(struct rpc_task *); | 146 | int rpcauth_uptodatecred(struct rpc_task *); |
diff --git a/include/linux/sunrpc/bc_xprt.h b/include/linux/sunrpc/bc_xprt.h index 7c91260c44a9..082884295f80 100644 --- a/include/linux/sunrpc/bc_xprt.h +++ b/include/linux/sunrpc/bc_xprt.h | |||
| @@ -43,7 +43,7 @@ int bc_send(struct rpc_rqst *req); | |||
| 43 | */ | 43 | */ |
| 44 | static inline int svc_is_backchannel(const struct svc_rqst *rqstp) | 44 | static 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 | } |
diff --git a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h index 6950c981882d..7898ea13de70 100644 --- a/include/linux/sunrpc/cache.h +++ b/include/linux/sunrpc/cache.h | |||
| @@ -13,6 +13,7 @@ | |||
| 13 | #ifndef _LINUX_SUNRPC_CACHE_H_ | 13 | #ifndef _LINUX_SUNRPC_CACHE_H_ |
| 14 | #define _LINUX_SUNRPC_CACHE_H_ | 14 | #define _LINUX_SUNRPC_CACHE_H_ |
| 15 | 15 | ||
| 16 | #include <linux/kref.h> | ||
| 16 | #include <linux/slab.h> | 17 | #include <linux/slab.h> |
| 17 | #include <asm/atomic.h> | 18 | #include <asm/atomic.h> |
| 18 | #include <linux/proc_fs.h> | 19 | #include <linux/proc_fs.h> |
| @@ -255,10 +256,13 @@ static inline time_t get_expiry(char **bpp) | |||
| 255 | return rv - boot.tv_sec; | 256 | return rv - boot.tv_sec; |
| 256 | } | 257 | } |
| 257 | 258 | ||
| 259 | #ifdef CONFIG_NFSD_DEPRECATED | ||
| 258 | static inline void sunrpc_invalidate(struct cache_head *h, | 260 | static inline void sunrpc_invalidate(struct cache_head *h, |
| 259 | struct cache_detail *detail) | 261 | struct cache_detail *detail) |
| 260 | { | 262 | { |
| 261 | h->expiry_time = seconds_since_boot() - 1; | 263 | h->expiry_time = seconds_since_boot() - 1; |
| 262 | detail->nextcheck = seconds_since_boot(); | 264 | detail->nextcheck = seconds_since_boot(); |
| 263 | } | 265 | } |
| 266 | #endif /* CONFIG_NFSD_DEPRECATED */ | ||
| 267 | |||
| 264 | #endif /* _LINUX_SUNRPC_CACHE_H_ */ | 268 | #endif /* _LINUX_SUNRPC_CACHE_H_ */ |
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 | */ |
| 90 | struct rpc_procinfo { | 90 | struct 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..ea29330b78bd 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 | ||
| @@ -269,6 +269,7 @@ struct svc_rqst { | |||
| 269 | struct cache_req rq_chandle; /* handle passed to caches for | 269 | struct cache_req rq_chandle; /* handle passed to caches for |
| 270 | * request delaying | 270 | * request delaying |
| 271 | */ | 271 | */ |
| 272 | bool rq_dropme; | ||
| 272 | /* Catering to nfsd */ | 273 | /* Catering to nfsd */ |
| 273 | struct auth_domain * rq_client; /* RPC peer info */ | 274 | struct auth_domain * rq_client; /* RPC peer info */ |
| 274 | struct auth_domain * rq_gssclient; /* "gss/"-style peer info */ | 275 | struct auth_domain * rq_gssclient; /* "gss/"-style peer info */ |
diff --git a/include/linux/sunrpc/svc_xprt.h b/include/linux/sunrpc/svc_xprt.h index bbdb680ffbe9..7ad9751a0d87 100644 --- a/include/linux/sunrpc/svc_xprt.h +++ b/include/linux/sunrpc/svc_xprt.h | |||
| @@ -63,7 +63,6 @@ struct svc_xprt { | |||
| 63 | #define XPT_LISTENER 11 /* listening endpoint */ | 63 | #define XPT_LISTENER 11 /* listening endpoint */ |
| 64 | #define XPT_CACHE_AUTH 12 /* cache auth info */ | 64 | #define XPT_CACHE_AUTH 12 /* cache auth info */ |
| 65 | 65 | ||
| 66 | struct svc_pool *xpt_pool; /* current pool iff queued */ | ||
| 67 | struct svc_serv *xpt_server; /* service for transport */ | 66 | struct svc_serv *xpt_server; /* service for transport */ |
| 68 | atomic_t xpt_reserved; /* space on outq that is rsvd */ | 67 | atomic_t xpt_reserved; /* space on outq that is rsvd */ |
| 69 | struct mutex xpt_mutex; /* to serialize sending data */ | 68 | struct mutex xpt_mutex; /* to serialize sending data */ |
| @@ -80,20 +79,31 @@ struct svc_xprt { | |||
| 80 | struct list_head xpt_users; /* callbacks on free */ | 79 | struct list_head xpt_users; /* callbacks on free */ |
| 81 | 80 | ||
| 82 | struct net *xpt_net; | 81 | struct net *xpt_net; |
| 82 | struct rpc_xprt *xpt_bc_xprt; /* NFSv4.1 backchannel */ | ||
| 83 | }; | 83 | }; |
| 84 | 84 | ||
| 85 | static inline void register_xpt_user(struct svc_xprt *xpt, struct svc_xpt_user *u) | 85 | static inline void unregister_xpt_user(struct svc_xprt *xpt, struct svc_xpt_user *u) |
| 86 | { | 86 | { |
| 87 | spin_lock(&xpt->xpt_lock); | 87 | spin_lock(&xpt->xpt_lock); |
| 88 | list_add(&u->list, &xpt->xpt_users); | 88 | list_del_init(&u->list); |
| 89 | spin_unlock(&xpt->xpt_lock); | 89 | spin_unlock(&xpt->xpt_lock); |
| 90 | } | 90 | } |
| 91 | 91 | ||
| 92 | static inline void unregister_xpt_user(struct svc_xprt *xpt, struct svc_xpt_user *u) | 92 | static inline int register_xpt_user(struct svc_xprt *xpt, struct svc_xpt_user *u) |
| 93 | { | 93 | { |
| 94 | spin_lock(&xpt->xpt_lock); | 94 | spin_lock(&xpt->xpt_lock); |
| 95 | list_del_init(&u->list); | 95 | if (test_bit(XPT_CLOSE, &xpt->xpt_flags)) { |
| 96 | /* | ||
| 97 | * The connection is about to be deleted soon (or, | ||
| 98 | * worse, may already be deleted--in which case we've | ||
| 99 | * already notified the xpt_users). | ||
| 100 | */ | ||
| 101 | spin_unlock(&xpt->xpt_lock); | ||
| 102 | return -ENOTCONN; | ||
| 103 | } | ||
| 104 | list_add(&u->list, &xpt->xpt_users); | ||
| 96 | spin_unlock(&xpt->xpt_lock); | 105 | spin_unlock(&xpt->xpt_lock); |
| 106 | return 0; | ||
| 97 | } | 107 | } |
| 98 | 108 | ||
| 99 | int svc_reg_xprt_class(struct svc_xprt_class *); | 109 | int svc_reg_xprt_class(struct svc_xprt_class *); |
diff --git a/include/linux/sunrpc/svcsock.h b/include/linux/sunrpc/svcsock.h index 1b353a76c304..04dba23c59f2 100644 --- a/include/linux/sunrpc/svcsock.h +++ b/include/linux/sunrpc/svcsock.h | |||
| @@ -28,7 +28,6 @@ struct svc_sock { | |||
| 28 | /* private TCP part */ | 28 | /* private TCP part */ |
| 29 | u32 sk_reclen; /* length of record */ | 29 | u32 sk_reclen; /* length of record */ |
| 30 | u32 sk_tcplen; /* current read length */ | 30 | u32 sk_tcplen; /* current read length */ |
| 31 | struct rpc_xprt *sk_bc_xprt; /* NFSv4.1 backchannel xprt */ | ||
| 32 | }; | 31 | }; |
| 33 | 32 | ||
| 34 | /* | 33 | /* |
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 | */ |
| 40 | typedef int (*kxdrproc_t)(void *rqstp, __be32 *data, void *obj); | 40 | typedef 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 | */ | ||
| 211 | typedef void (*kxdreproc_t)(void *rqstp, struct xdr_stream *xdr, void *obj); | ||
| 212 | typedef int (*kxdrdproc_t)(void *rqstp, struct xdr_stream *xdr, void *obj); | ||
| 213 | |||
| 206 | extern void xdr_init_encode(struct xdr_stream *xdr, struct xdr_buf *buf, __be32 *p); | 214 | extern void xdr_init_encode(struct xdr_stream *xdr, struct xdr_buf *buf, __be32 *p); |
| 207 | extern __be32 *xdr_reserve_space(struct xdr_stream *xdr, size_t nbytes); | 215 | extern __be32 *xdr_reserve_space(struct xdr_stream *xdr, size_t nbytes); |
| 208 | extern void xdr_write_pages(struct xdr_stream *xdr, struct page **pages, | 216 | extern 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); |
| 210 | extern void xdr_init_decode(struct xdr_stream *xdr, struct xdr_buf *buf, __be32 *p); | 218 | extern void xdr_init_decode(struct xdr_stream *xdr, struct xdr_buf *buf, __be32 *p); |
| 211 | extern __be32 *xdr_inline_peek(struct xdr_stream *xdr, size_t nbytes); | 219 | extern void xdr_set_scratch_buffer(struct xdr_stream *xdr, void *buf, size_t buflen); |
| 212 | extern __be32 *xdr_inline_decode(struct xdr_stream *xdr, size_t nbytes); | 220 | extern __be32 *xdr_inline_decode(struct xdr_stream *xdr, size_t nbytes); |
| 213 | extern void xdr_read_pages(struct xdr_stream *xdr, unsigned int len); | 221 | extern void xdr_read_pages(struct xdr_stream *xdr, unsigned int len); |
| 214 | extern void xdr_enter_page(struct xdr_stream *xdr, unsigned int len); | 222 | extern void xdr_enter_page(struct xdr_stream *xdr, unsigned int len); |
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h index 89d10d279a20..bef0f535f746 100644 --- a/include/linux/sunrpc/xprt.h +++ b/include/linux/sunrpc/xprt.h | |||
| @@ -321,6 +321,7 @@ void xprt_conditional_disconnect(struct rpc_xprt *xprt, unsigned int cookie); | |||
| 321 | #define XPRT_CLOSING (6) | 321 | #define XPRT_CLOSING (6) |
| 322 | #define XPRT_CONNECTION_ABORT (7) | 322 | #define XPRT_CONNECTION_ABORT (7) |
| 323 | #define XPRT_CONNECTION_CLOSE (8) | 323 | #define XPRT_CONNECTION_CLOSE (8) |
| 324 | #define XPRT_INITIALIZED (9) | ||
| 324 | 325 | ||
| 325 | static inline void xprt_set_connected(struct rpc_xprt *xprt) | 326 | static inline void xprt_set_connected(struct rpc_xprt *xprt) |
| 326 | { | 327 | { |
