diff options
Diffstat (limited to 'include/linux/sunrpc')
| -rw-r--r-- | include/linux/sunrpc/auth.h | 2 | ||||
| -rw-r--r-- | include/linux/sunrpc/cache.h | 34 | ||||
| -rw-r--r-- | include/linux/sunrpc/gss_api.h | 3 | ||||
| -rw-r--r-- | include/linux/sunrpc/svc.h | 2 | ||||
| -rw-r--r-- | include/linux/sunrpc/xdr.h | 6 | ||||
| -rw-r--r-- | include/linux/sunrpc/xprt.h | 3 |
6 files changed, 38 insertions, 12 deletions
diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h index 492a36d72829..f25ba922baaf 100644 --- a/include/linux/sunrpc/auth.h +++ b/include/linux/sunrpc/auth.h | |||
| @@ -101,6 +101,7 @@ struct rpc_authops { | |||
| 101 | struct rpc_cred * (*crcreate)(struct rpc_auth*, struct auth_cred *, int); | 101 | struct rpc_cred * (*crcreate)(struct rpc_auth*, struct auth_cred *, int); |
| 102 | int (*pipes_create)(struct rpc_auth *); | 102 | int (*pipes_create)(struct rpc_auth *); |
| 103 | void (*pipes_destroy)(struct rpc_auth *); | 103 | void (*pipes_destroy)(struct rpc_auth *); |
| 104 | int (*list_pseudoflavors)(rpc_authflavor_t *, int); | ||
| 104 | }; | 105 | }; |
| 105 | 106 | ||
| 106 | struct rpc_credops { | 107 | struct rpc_credops { |
| @@ -135,6 +136,7 @@ int rpcauth_register(const struct rpc_authops *); | |||
| 135 | int rpcauth_unregister(const struct rpc_authops *); | 136 | int rpcauth_unregister(const struct rpc_authops *); |
| 136 | struct rpc_auth * rpcauth_create(rpc_authflavor_t, struct rpc_clnt *); | 137 | struct rpc_auth * rpcauth_create(rpc_authflavor_t, struct rpc_clnt *); |
| 137 | void rpcauth_release(struct rpc_auth *); | 138 | void rpcauth_release(struct rpc_auth *); |
| 139 | int rpcauth_list_flavors(rpc_authflavor_t *, int); | ||
| 138 | struct rpc_cred * rpcauth_lookup_credcache(struct rpc_auth *, struct auth_cred *, int); | 140 | struct rpc_cred * rpcauth_lookup_credcache(struct rpc_auth *, struct auth_cred *, int); |
| 139 | void rpcauth_init_cred(struct rpc_cred *, const struct auth_cred *, struct rpc_auth *, const struct rpc_credops *); | 141 | void rpcauth_init_cred(struct rpc_cred *, const struct auth_cred *, struct rpc_auth *, const struct rpc_credops *); |
| 140 | struct rpc_cred * rpcauth_lookupcred(struct rpc_auth *, int); | 142 | struct rpc_cred * rpcauth_lookupcred(struct rpc_auth *, int); |
diff --git a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h index f5fd6160dbca..f792794f6634 100644 --- a/include/linux/sunrpc/cache.h +++ b/include/linux/sunrpc/cache.h | |||
| @@ -217,14 +217,32 @@ extern int qword_get(char **bpp, char *dest, int bufsize); | |||
| 217 | static inline int get_int(char **bpp, int *anint) | 217 | static inline int get_int(char **bpp, int *anint) |
| 218 | { | 218 | { |
| 219 | char buf[50]; | 219 | char buf[50]; |
| 220 | char *ep; | 220 | int len = qword_get(bpp, buf, sizeof(buf)); |
| 221 | int rv; | 221 | |
| 222 | int len = qword_get(bpp, buf, 50); | 222 | if (len < 0) |
| 223 | if (len < 0) return -EINVAL; | 223 | return -EINVAL; |
| 224 | if (len ==0) return -ENOENT; | 224 | if (len == 0) |
| 225 | rv = simple_strtol(buf, &ep, 0); | 225 | return -ENOENT; |
| 226 | if (*ep) return -EINVAL; | 226 | |
| 227 | *anint = rv; | 227 | if (kstrtoint(buf, 0, anint)) |
| 228 | return -EINVAL; | ||
| 229 | |||
| 230 | return 0; | ||
| 231 | } | ||
| 232 | |||
| 233 | static inline int get_uint(char **bpp, unsigned int *anint) | ||
| 234 | { | ||
| 235 | char buf[50]; | ||
| 236 | int len = qword_get(bpp, buf, sizeof(buf)); | ||
| 237 | |||
| 238 | if (len < 0) | ||
| 239 | return -EINVAL; | ||
| 240 | if (len == 0) | ||
| 241 | return -ENOENT; | ||
| 242 | |||
| 243 | if (kstrtouint(buf, 0, anint)) | ||
| 244 | return -EINVAL; | ||
| 245 | |||
| 228 | return 0; | 246 | return 0; |
| 229 | } | 247 | } |
| 230 | 248 | ||
diff --git a/include/linux/sunrpc/gss_api.h b/include/linux/sunrpc/gss_api.h index 332da61cf8b7..a19e2547ae6a 100644 --- a/include/linux/sunrpc/gss_api.h +++ b/include/linux/sunrpc/gss_api.h | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | 14 | ||
| 15 | #ifdef __KERNEL__ | 15 | #ifdef __KERNEL__ |
| 16 | #include <linux/sunrpc/xdr.h> | 16 | #include <linux/sunrpc/xdr.h> |
| 17 | #include <linux/sunrpc/msg_prot.h> | ||
| 17 | #include <linux/uio.h> | 18 | #include <linux/uio.h> |
| 18 | 19 | ||
| 19 | /* The mechanism-independent gss-api context: */ | 20 | /* The mechanism-independent gss-api context: */ |
| @@ -127,7 +128,7 @@ struct gss_api_mech *gss_mech_get_by_name(const char *); | |||
| 127 | struct gss_api_mech *gss_mech_get_by_pseudoflavor(u32); | 128 | struct gss_api_mech *gss_mech_get_by_pseudoflavor(u32); |
| 128 | 129 | ||
| 129 | /* Fill in an array with a list of supported pseudoflavors */ | 130 | /* Fill in an array with a list of supported pseudoflavors */ |
| 130 | int gss_mech_list_pseudoflavors(u32 *); | 131 | int gss_mech_list_pseudoflavors(rpc_authflavor_t *, int); |
| 131 | 132 | ||
| 132 | /* Just increments the mechanism's reference count and returns its input: */ | 133 | /* Just increments the mechanism's reference count and returns its input: */ |
| 133 | struct gss_api_mech * gss_mech_get(struct gss_api_mech *); | 134 | struct gss_api_mech * gss_mech_get(struct gss_api_mech *); |
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index 40e0a273faea..d83db800fe02 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h | |||
| @@ -278,6 +278,8 @@ struct svc_rqst { | |||
| 278 | struct task_struct *rq_task; /* service thread */ | 278 | struct task_struct *rq_task; /* service thread */ |
| 279 | }; | 279 | }; |
| 280 | 280 | ||
| 281 | #define SVC_NET(svc_rqst) (svc_rqst->rq_xprt->xpt_net) | ||
| 282 | |||
| 281 | /* | 283 | /* |
| 282 | * Rigorous type checking on sockaddr type conversions | 284 | * Rigorous type checking on sockaddr type conversions |
| 283 | */ | 285 | */ |
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h index af70af333546..63988990bd36 100644 --- a/include/linux/sunrpc/xdr.h +++ b/include/linux/sunrpc/xdr.h | |||
| @@ -104,8 +104,6 @@ __be32 *xdr_decode_string_inplace(__be32 *p, char **sp, unsigned int *lenp, | |||
| 104 | __be32 *xdr_encode_netobj(__be32 *p, const struct xdr_netobj *); | 104 | __be32 *xdr_encode_netobj(__be32 *p, const struct xdr_netobj *); |
| 105 | __be32 *xdr_decode_netobj(__be32 *p, struct xdr_netobj *); | 105 | __be32 *xdr_decode_netobj(__be32 *p, struct xdr_netobj *); |
| 106 | 106 | ||
| 107 | void xdr_encode_pages(struct xdr_buf *, struct page **, unsigned int, | ||
| 108 | unsigned int); | ||
| 109 | void xdr_inline_pages(struct xdr_buf *, unsigned int, | 107 | void xdr_inline_pages(struct xdr_buf *, unsigned int, |
| 110 | struct page **, unsigned int, unsigned int); | 108 | struct page **, unsigned int, unsigned int); |
| 111 | void xdr_terminate_string(struct xdr_buf *, const u32); | 109 | void xdr_terminate_string(struct xdr_buf *, const u32); |
| @@ -205,6 +203,7 @@ struct xdr_stream { | |||
| 205 | struct kvec *iov; /* pointer to the current kvec */ | 203 | struct kvec *iov; /* pointer to the current kvec */ |
| 206 | struct kvec scratch; /* Scratch buffer */ | 204 | struct kvec scratch; /* Scratch buffer */ |
| 207 | struct page **page_ptr; /* pointer to the current page */ | 205 | struct page **page_ptr; /* pointer to the current page */ |
| 206 | unsigned int nwords; /* Remaining decode buffer length */ | ||
| 208 | }; | 207 | }; |
| 209 | 208 | ||
| 210 | /* | 209 | /* |
| @@ -217,12 +216,13 @@ extern void xdr_init_encode(struct xdr_stream *xdr, struct xdr_buf *buf, __be32 | |||
| 217 | extern __be32 *xdr_reserve_space(struct xdr_stream *xdr, size_t nbytes); | 216 | extern __be32 *xdr_reserve_space(struct xdr_stream *xdr, size_t nbytes); |
| 218 | extern void xdr_write_pages(struct xdr_stream *xdr, struct page **pages, | 217 | extern void xdr_write_pages(struct xdr_stream *xdr, struct page **pages, |
| 219 | unsigned int base, unsigned int len); | 218 | unsigned int base, unsigned int len); |
| 219 | extern unsigned int xdr_stream_pos(const struct xdr_stream *xdr); | ||
| 220 | extern void xdr_init_decode(struct xdr_stream *xdr, struct xdr_buf *buf, __be32 *p); | 220 | extern void xdr_init_decode(struct xdr_stream *xdr, struct xdr_buf *buf, __be32 *p); |
| 221 | extern void xdr_init_decode_pages(struct xdr_stream *xdr, struct xdr_buf *buf, | 221 | extern void xdr_init_decode_pages(struct xdr_stream *xdr, struct xdr_buf *buf, |
| 222 | struct page **pages, unsigned int len); | 222 | struct page **pages, unsigned int len); |
| 223 | extern void xdr_set_scratch_buffer(struct xdr_stream *xdr, void *buf, size_t buflen); | 223 | extern void xdr_set_scratch_buffer(struct xdr_stream *xdr, void *buf, size_t buflen); |
| 224 | extern __be32 *xdr_inline_decode(struct xdr_stream *xdr, size_t nbytes); | 224 | extern __be32 *xdr_inline_decode(struct xdr_stream *xdr, size_t nbytes); |
| 225 | extern void xdr_read_pages(struct xdr_stream *xdr, unsigned int len); | 225 | extern unsigned int xdr_read_pages(struct xdr_stream *xdr, unsigned int len); |
| 226 | extern void xdr_enter_page(struct xdr_stream *xdr, unsigned int len); | 226 | extern void xdr_enter_page(struct xdr_stream *xdr, unsigned int len); |
| 227 | extern int xdr_process_buf(struct xdr_buf *buf, unsigned int offset, unsigned int len, int (*actor)(struct scatterlist *, void *), void *data); | 227 | extern int xdr_process_buf(struct xdr_buf *buf, unsigned int offset, unsigned int len, int (*actor)(struct scatterlist *, void *), void *data); |
| 228 | 228 | ||
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h index 77d278defa70..cff40aa7db62 100644 --- a/include/linux/sunrpc/xprt.h +++ b/include/linux/sunrpc/xprt.h | |||
| @@ -174,6 +174,8 @@ struct rpc_xprt { | |||
| 174 | unsigned long state; /* transport state */ | 174 | unsigned long state; /* transport state */ |
| 175 | unsigned char shutdown : 1, /* being shut down */ | 175 | unsigned char shutdown : 1, /* being shut down */ |
| 176 | resvport : 1; /* use a reserved port */ | 176 | resvport : 1; /* use a reserved port */ |
| 177 | unsigned int swapper; /* we're swapping over this | ||
| 178 | transport */ | ||
| 177 | unsigned int bind_index; /* bind function index */ | 179 | unsigned int bind_index; /* bind function index */ |
| 178 | 180 | ||
| 179 | /* | 181 | /* |
| @@ -316,6 +318,7 @@ void xprt_release_rqst_cong(struct rpc_task *task); | |||
| 316 | void xprt_disconnect_done(struct rpc_xprt *xprt); | 318 | void xprt_disconnect_done(struct rpc_xprt *xprt); |
| 317 | void xprt_force_disconnect(struct rpc_xprt *xprt); | 319 | void xprt_force_disconnect(struct rpc_xprt *xprt); |
| 318 | void xprt_conditional_disconnect(struct rpc_xprt *xprt, unsigned int cookie); | 320 | void xprt_conditional_disconnect(struct rpc_xprt *xprt, unsigned int cookie); |
| 321 | int xs_swapper(struct rpc_xprt *xprt, int enable); | ||
| 319 | 322 | ||
| 320 | /* | 323 | /* |
| 321 | * Reserved bit positions in xprt->state | 324 | * Reserved bit positions in xprt->state |
