diff options
Diffstat (limited to 'include/linux/sunrpc')
| -rw-r--r-- | include/linux/sunrpc/Kbuild | 2 | ||||
| -rw-r--r-- | include/linux/sunrpc/auth.h | 22 | ||||
| -rw-r--r-- | include/linux/sunrpc/auth_gss.h | 1 | ||||
| -rw-r--r-- | include/linux/sunrpc/bc_xprt.h | 20 | ||||
| -rw-r--r-- | include/linux/sunrpc/cache.h | 1 | ||||
| -rw-r--r-- | include/linux/sunrpc/clnt.h | 7 | ||||
| -rw-r--r-- | include/linux/sunrpc/gss_api.h | 8 | ||||
| -rw-r--r-- | include/linux/sunrpc/gss_krb5.h | 184 | ||||
| -rw-r--r-- | include/linux/sunrpc/metrics.h | 7 | ||||
| -rw-r--r-- | include/linux/sunrpc/sched.h | 27 | ||||
| -rw-r--r-- | include/linux/sunrpc/xdr.h | 8 | ||||
| -rw-r--r-- | include/linux/sunrpc/xprt.h | 14 |
12 files changed, 244 insertions, 57 deletions
diff --git a/include/linux/sunrpc/Kbuild b/include/linux/sunrpc/Kbuild index fb438f158eee..98df21164a86 100644 --- a/include/linux/sunrpc/Kbuild +++ b/include/linux/sunrpc/Kbuild | |||
| @@ -1 +1 @@ | |||
| unifdef-y += debug.h | header-y += debug.h | ||
diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h index 996df4dac7d4..5bbc447175dc 100644 --- a/include/linux/sunrpc/auth.h +++ b/include/linux/sunrpc/auth.h | |||
| @@ -54,19 +54,14 @@ struct rpc_cred { | |||
| 54 | #define RPCAUTH_CRED_NEW 0 | 54 | #define RPCAUTH_CRED_NEW 0 |
| 55 | #define RPCAUTH_CRED_UPTODATE 1 | 55 | #define RPCAUTH_CRED_UPTODATE 1 |
| 56 | #define RPCAUTH_CRED_HASHED 2 | 56 | #define RPCAUTH_CRED_HASHED 2 |
| 57 | #define RPCAUTH_CRED_NEGATIVE 3 | ||
| 57 | 58 | ||
| 58 | #define RPCAUTH_CRED_MAGIC 0x0f4aa4f0 | 59 | #define RPCAUTH_CRED_MAGIC 0x0f4aa4f0 |
| 59 | 60 | ||
| 60 | /* | 61 | /* |
| 61 | * Client authentication handle | 62 | * Client authentication handle |
| 62 | */ | 63 | */ |
| 63 | #define RPC_CREDCACHE_HASHBITS 4 | 64 | struct rpc_cred_cache; |
| 64 | #define RPC_CREDCACHE_NR (1 << RPC_CREDCACHE_HASHBITS) | ||
| 65 | struct rpc_cred_cache { | ||
| 66 | struct hlist_head hashtable[RPC_CREDCACHE_NR]; | ||
| 67 | spinlock_t lock; | ||
| 68 | }; | ||
| 69 | |||
| 70 | struct rpc_authops; | 65 | struct rpc_authops; |
| 71 | struct rpc_auth { | 66 | struct rpc_auth { |
| 72 | unsigned int au_cslack; /* call cred size estimate */ | 67 | unsigned int au_cslack; /* call cred size estimate */ |
| @@ -111,7 +106,7 @@ struct rpc_credops { | |||
| 111 | void (*crdestroy)(struct rpc_cred *); | 106 | void (*crdestroy)(struct rpc_cred *); |
| 112 | 107 | ||
| 113 | int (*crmatch)(struct auth_cred *, struct rpc_cred *, int); | 108 | int (*crmatch)(struct auth_cred *, struct rpc_cred *, int); |
| 114 | void (*crbind)(struct rpc_task *, struct rpc_cred *, int); | 109 | struct rpc_cred * (*crbind)(struct rpc_task *, struct rpc_cred *, int); |
| 115 | __be32 * (*crmarshal)(struct rpc_task *, __be32 *); | 110 | __be32 * (*crmarshal)(struct rpc_task *, __be32 *); |
| 116 | int (*crrefresh)(struct rpc_task *); | 111 | int (*crrefresh)(struct rpc_task *); |
| 117 | __be32 * (*crvalidate)(struct rpc_task *, __be32 *); | 112 | __be32 * (*crvalidate)(struct rpc_task *, __be32 *); |
| @@ -124,11 +119,12 @@ struct rpc_credops { | |||
| 124 | extern const struct rpc_authops authunix_ops; | 119 | extern const struct rpc_authops authunix_ops; |
| 125 | extern const struct rpc_authops authnull_ops; | 120 | extern const struct rpc_authops authnull_ops; |
| 126 | 121 | ||
| 127 | void __init rpc_init_authunix(void); | 122 | int __init rpc_init_authunix(void); |
| 128 | void __init rpc_init_generic_auth(void); | 123 | int __init rpc_init_generic_auth(void); |
| 129 | void __init rpcauth_init_module(void); | 124 | int __init rpcauth_init_module(void); |
| 130 | void __exit rpcauth_remove_module(void); | 125 | void __exit rpcauth_remove_module(void); |
| 131 | void __exit rpc_destroy_generic_auth(void); | 126 | void __exit rpc_destroy_generic_auth(void); |
| 127 | void rpc_destroy_authunix(void); | ||
| 132 | 128 | ||
| 133 | struct rpc_cred * rpc_lookup_cred(void); | 129 | struct rpc_cred * rpc_lookup_cred(void); |
| 134 | struct rpc_cred * rpc_lookup_machine_cred(void); | 130 | struct rpc_cred * rpc_lookup_machine_cred(void); |
| @@ -139,10 +135,8 @@ void rpcauth_release(struct rpc_auth *); | |||
| 139 | struct rpc_cred * rpcauth_lookup_credcache(struct rpc_auth *, struct auth_cred *, int); | 135 | struct rpc_cred * rpcauth_lookup_credcache(struct rpc_auth *, struct auth_cred *, int); |
| 140 | void rpcauth_init_cred(struct rpc_cred *, const struct auth_cred *, struct rpc_auth *, const struct rpc_credops *); | 136 | void rpcauth_init_cred(struct rpc_cred *, const struct auth_cred *, struct rpc_auth *, const struct rpc_credops *); |
| 141 | struct rpc_cred * rpcauth_lookupcred(struct rpc_auth *, int); | 137 | struct rpc_cred * rpcauth_lookupcred(struct rpc_auth *, int); |
| 142 | void rpcauth_bindcred(struct rpc_task *, struct rpc_cred *, int); | 138 | struct rpc_cred * rpcauth_generic_bind_cred(struct rpc_task *, struct rpc_cred *, int); |
| 143 | void rpcauth_generic_bind_cred(struct rpc_task *, struct rpc_cred *, int); | ||
| 144 | void put_rpccred(struct rpc_cred *); | 139 | void put_rpccred(struct rpc_cred *); |
| 145 | void rpcauth_unbindcred(struct rpc_task *); | ||
| 146 | __be32 * rpcauth_marshcred(struct rpc_task *, __be32 *); | 140 | __be32 * rpcauth_marshcred(struct rpc_task *, __be32 *); |
| 147 | __be32 * rpcauth_checkverf(struct rpc_task *, __be32 *); | 141 | __be32 * rpcauth_checkverf(struct rpc_task *, __be32 *); |
| 148 | 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, kxdrproc_t encode, void *rqstp, __be32 *data, void *obj); |
diff --git a/include/linux/sunrpc/auth_gss.h b/include/linux/sunrpc/auth_gss.h index d48d4e605f74..671538d25bc1 100644 --- a/include/linux/sunrpc/auth_gss.h +++ b/include/linux/sunrpc/auth_gss.h | |||
| @@ -82,6 +82,7 @@ struct gss_cred { | |||
| 82 | enum rpc_gss_svc gc_service; | 82 | enum rpc_gss_svc gc_service; |
| 83 | struct gss_cl_ctx *gc_ctx; | 83 | struct gss_cl_ctx *gc_ctx; |
| 84 | struct gss_upcall_msg *gc_upcall; | 84 | struct gss_upcall_msg *gc_upcall; |
| 85 | unsigned long gc_upcall_timestamp; | ||
| 85 | unsigned char gc_machine_cred : 1; | 86 | unsigned char gc_machine_cred : 1; |
| 86 | }; | 87 | }; |
| 87 | 88 | ||
diff --git a/include/linux/sunrpc/bc_xprt.h b/include/linux/sunrpc/bc_xprt.h index 6508f0dc0eff..7c91260c44a9 100644 --- a/include/linux/sunrpc/bc_xprt.h +++ b/include/linux/sunrpc/bc_xprt.h | |||
| @@ -36,14 +36,32 @@ struct rpc_rqst *xprt_alloc_bc_request(struct rpc_xprt *xprt); | |||
| 36 | void xprt_free_bc_request(struct rpc_rqst *req); | 36 | void xprt_free_bc_request(struct rpc_rqst *req); |
| 37 | int xprt_setup_backchannel(struct rpc_xprt *, unsigned int min_reqs); | 37 | int xprt_setup_backchannel(struct rpc_xprt *, unsigned int min_reqs); |
| 38 | void xprt_destroy_backchannel(struct rpc_xprt *, int max_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); | 39 | int bc_send(struct rpc_rqst *req); |
| 40 | |||
| 41 | /* | ||
| 42 | * Determine if a shared backchannel is in use | ||
| 43 | */ | ||
| 44 | static inline int svc_is_backchannel(const struct svc_rqst *rqstp) | ||
| 45 | { | ||
| 46 | if (rqstp->rq_server->bc_xprt) | ||
| 47 | return 1; | ||
| 48 | return 0; | ||
| 49 | } | ||
| 41 | #else /* CONFIG_NFS_V4_1 */ | 50 | #else /* CONFIG_NFS_V4_1 */ |
| 42 | static inline int xprt_setup_backchannel(struct rpc_xprt *xprt, | 51 | static inline int xprt_setup_backchannel(struct rpc_xprt *xprt, |
| 43 | unsigned int min_reqs) | 52 | unsigned int min_reqs) |
| 44 | { | 53 | { |
| 45 | return 0; | 54 | return 0; |
| 46 | } | 55 | } |
| 56 | |||
| 57 | static inline int svc_is_backchannel(const struct svc_rqst *rqstp) | ||
| 58 | { | ||
| 59 | return 0; | ||
| 60 | } | ||
| 61 | |||
| 62 | static inline void xprt_free_bc_request(struct rpc_rqst *req) | ||
| 63 | { | ||
| 64 | } | ||
| 47 | #endif /* CONFIG_NFS_V4_1 */ | 65 | #endif /* CONFIG_NFS_V4_1 */ |
| 48 | #endif /* _LINUX_SUNRPC_BC_XPRT_H */ | 66 | #endif /* _LINUX_SUNRPC_BC_XPRT_H */ |
| 49 | 67 | ||
diff --git a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h index 6f52b4d7c447..7bf3e84b92f4 100644 --- a/include/linux/sunrpc/cache.h +++ b/include/linux/sunrpc/cache.h | |||
| @@ -192,6 +192,7 @@ extern int cache_check(struct cache_detail *detail, | |||
| 192 | extern void cache_flush(void); | 192 | extern void cache_flush(void); |
| 193 | extern void cache_purge(struct cache_detail *detail); | 193 | extern void cache_purge(struct cache_detail *detail); |
| 194 | #define NEVER (0x7FFFFFFF) | 194 | #define NEVER (0x7FFFFFFF) |
| 195 | extern void __init cache_initialize(void); | ||
| 195 | extern int cache_register(struct cache_detail *cd); | 196 | extern int cache_register(struct cache_detail *cd); |
| 196 | extern void cache_unregister(struct cache_detail *cd); | 197 | extern void cache_unregister(struct cache_detail *cd); |
| 197 | 198 | ||
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h index 8ed9642a5a76..85f38a63f098 100644 --- a/include/linux/sunrpc/clnt.h +++ b/include/linux/sunrpc/clnt.h | |||
| @@ -30,7 +30,7 @@ struct rpc_inode; | |||
| 30 | * The high-level client handle | 30 | * The high-level client handle |
| 31 | */ | 31 | */ |
| 32 | struct rpc_clnt { | 32 | struct rpc_clnt { |
| 33 | struct kref cl_kref; /* Number of references */ | 33 | atomic_t cl_count; /* Number of references */ |
| 34 | struct list_head cl_clients; /* Global list of clients */ | 34 | struct list_head cl_clients; /* Global list of clients */ |
| 35 | struct list_head cl_tasks; /* List of tasks */ | 35 | struct list_head cl_tasks; /* List of tasks */ |
| 36 | spinlock_t cl_lock; /* spinlock */ | 36 | spinlock_t cl_lock; /* spinlock */ |
| @@ -131,6 +131,7 @@ struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *, | |||
| 131 | struct rpc_clnt *rpc_clone_client(struct rpc_clnt *); | 131 | struct rpc_clnt *rpc_clone_client(struct rpc_clnt *); |
| 132 | void rpc_shutdown_client(struct rpc_clnt *); | 132 | void rpc_shutdown_client(struct rpc_clnt *); |
| 133 | void rpc_release_client(struct rpc_clnt *); | 133 | void rpc_release_client(struct rpc_clnt *); |
| 134 | void rpc_task_release_client(struct rpc_task *); | ||
| 134 | 135 | ||
| 135 | int rpcb_register(u32, u32, int, unsigned short); | 136 | int rpcb_register(u32, u32, int, unsigned short); |
| 136 | int rpcb_v4_register(const u32 program, const u32 version, | 137 | int rpcb_v4_register(const u32 program, const u32 version, |
| @@ -148,8 +149,8 @@ int rpc_call_sync(struct rpc_clnt *clnt, | |||
| 148 | const struct rpc_message *msg, int flags); | 149 | const struct rpc_message *msg, int flags); |
| 149 | struct rpc_task *rpc_call_null(struct rpc_clnt *clnt, struct rpc_cred *cred, | 150 | struct rpc_task *rpc_call_null(struct rpc_clnt *clnt, struct rpc_cred *cred, |
| 150 | int flags); | 151 | int flags); |
| 151 | void rpc_restart_call_prepare(struct rpc_task *); | 152 | int rpc_restart_call_prepare(struct rpc_task *); |
| 152 | void rpc_restart_call(struct rpc_task *); | 153 | int rpc_restart_call(struct rpc_task *); |
| 153 | void rpc_setbufsize(struct rpc_clnt *, unsigned int, unsigned int); | 154 | void rpc_setbufsize(struct rpc_clnt *, unsigned int, unsigned int); |
| 154 | size_t rpc_max_payload(struct rpc_clnt *); | 155 | size_t rpc_max_payload(struct rpc_clnt *); |
| 155 | void rpc_force_rebind(struct rpc_clnt *); | 156 | void rpc_force_rebind(struct rpc_clnt *); |
diff --git a/include/linux/sunrpc/gss_api.h b/include/linux/sunrpc/gss_api.h index 03f33330ece2..5d8048beb051 100644 --- a/include/linux/sunrpc/gss_api.h +++ b/include/linux/sunrpc/gss_api.h | |||
| @@ -35,7 +35,8 @@ int gss_import_sec_context( | |||
| 35 | const void* input_token, | 35 | const void* input_token, |
| 36 | size_t bufsize, | 36 | size_t bufsize, |
| 37 | struct gss_api_mech *mech, | 37 | struct gss_api_mech *mech, |
| 38 | struct gss_ctx **ctx_id); | 38 | struct gss_ctx **ctx_id, |
| 39 | gfp_t gfp_mask); | ||
| 39 | u32 gss_get_mic( | 40 | u32 gss_get_mic( |
| 40 | struct gss_ctx *ctx_id, | 41 | struct gss_ctx *ctx_id, |
| 41 | struct xdr_buf *message, | 42 | struct xdr_buf *message, |
| @@ -80,6 +81,8 @@ struct gss_api_mech { | |||
| 80 | /* pseudoflavors supported by this mechanism: */ | 81 | /* pseudoflavors supported by this mechanism: */ |
| 81 | int gm_pf_num; | 82 | int gm_pf_num; |
| 82 | struct pf_desc * gm_pfs; | 83 | struct pf_desc * gm_pfs; |
| 84 | /* Should the following be a callback operation instead? */ | ||
| 85 | const char *gm_upcall_enctypes; | ||
| 83 | }; | 86 | }; |
| 84 | 87 | ||
| 85 | /* and must provide the following operations: */ | 88 | /* and must provide the following operations: */ |
| @@ -87,7 +90,8 @@ struct gss_api_ops { | |||
| 87 | int (*gss_import_sec_context)( | 90 | int (*gss_import_sec_context)( |
| 88 | const void *input_token, | 91 | const void *input_token, |
| 89 | size_t bufsize, | 92 | size_t bufsize, |
| 90 | struct gss_ctx *ctx_id); | 93 | struct gss_ctx *ctx_id, |
| 94 | gfp_t gfp_mask); | ||
| 91 | u32 (*gss_get_mic)( | 95 | u32 (*gss_get_mic)( |
| 92 | struct gss_ctx *ctx_id, | 96 | struct gss_ctx *ctx_id, |
| 93 | struct xdr_buf *message, | 97 | struct xdr_buf *message, |
diff --git a/include/linux/sunrpc/gss_krb5.h b/include/linux/sunrpc/gss_krb5.h index e7bbdba474d5..5af2931cf58d 100644 --- a/include/linux/sunrpc/gss_krb5.h +++ b/include/linux/sunrpc/gss_krb5.h | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | * Adapted from MIT Kerberos 5-1.2.1 lib/include/krb5.h, | 4 | * Adapted from MIT Kerberos 5-1.2.1 lib/include/krb5.h, |
| 5 | * lib/gssapi/krb5/gssapiP_krb5.h, and others | 5 | * lib/gssapi/krb5/gssapiP_krb5.h, and others |
| 6 | * | 6 | * |
| 7 | * Copyright (c) 2000 The Regents of the University of Michigan. | 7 | * Copyright (c) 2000-2008 The Regents of the University of Michigan. |
| 8 | * All rights reserved. | 8 | * All rights reserved. |
| 9 | * | 9 | * |
| 10 | * Andy Adamson <andros@umich.edu> | 10 | * Andy Adamson <andros@umich.edu> |
| @@ -36,17 +36,86 @@ | |||
| 36 | * | 36 | * |
| 37 | */ | 37 | */ |
| 38 | 38 | ||
| 39 | #include <linux/crypto.h> | ||
| 39 | #include <linux/sunrpc/auth_gss.h> | 40 | #include <linux/sunrpc/auth_gss.h> |
| 40 | #include <linux/sunrpc/gss_err.h> | 41 | #include <linux/sunrpc/gss_err.h> |
| 41 | #include <linux/sunrpc/gss_asn1.h> | 42 | #include <linux/sunrpc/gss_asn1.h> |
| 42 | 43 | ||
| 44 | /* Length of constant used in key derivation */ | ||
| 45 | #define GSS_KRB5_K5CLENGTH (5) | ||
| 46 | |||
| 47 | /* Maximum key length (in bytes) for the supported crypto algorithms*/ | ||
| 48 | #define GSS_KRB5_MAX_KEYLEN (32) | ||
| 49 | |||
| 50 | /* Maximum checksum function output for the supported crypto algorithms */ | ||
| 51 | #define GSS_KRB5_MAX_CKSUM_LEN (20) | ||
| 52 | |||
| 53 | /* Maximum blocksize for the supported crypto algorithms */ | ||
| 54 | #define GSS_KRB5_MAX_BLOCKSIZE (16) | ||
| 55 | |||
| 56 | struct krb5_ctx; | ||
| 57 | |||
| 58 | struct gss_krb5_enctype { | ||
| 59 | const u32 etype; /* encryption (key) type */ | ||
| 60 | const u32 ctype; /* checksum type */ | ||
| 61 | const char *name; /* "friendly" name */ | ||
| 62 | const char *encrypt_name; /* crypto encrypt name */ | ||
| 63 | const char *cksum_name; /* crypto checksum name */ | ||
| 64 | const u16 signalg; /* signing algorithm */ | ||
| 65 | const u16 sealalg; /* sealing algorithm */ | ||
| 66 | const u32 blocksize; /* encryption blocksize */ | ||
| 67 | const u32 conflen; /* confounder length | ||
| 68 | (normally the same as | ||
| 69 | the blocksize) */ | ||
| 70 | const u32 cksumlength; /* checksum length */ | ||
| 71 | const u32 keyed_cksum; /* is it a keyed cksum? */ | ||
| 72 | const u32 keybytes; /* raw key len, in bytes */ | ||
| 73 | const u32 keylength; /* final key len, in bytes */ | ||
| 74 | u32 (*encrypt) (struct crypto_blkcipher *tfm, | ||
| 75 | void *iv, void *in, void *out, | ||
| 76 | int length); /* encryption function */ | ||
| 77 | u32 (*decrypt) (struct crypto_blkcipher *tfm, | ||
| 78 | void *iv, void *in, void *out, | ||
| 79 | int length); /* decryption function */ | ||
| 80 | u32 (*mk_key) (const struct gss_krb5_enctype *gk5e, | ||
| 81 | struct xdr_netobj *in, | ||
| 82 | struct xdr_netobj *out); /* complete key generation */ | ||
| 83 | u32 (*encrypt_v2) (struct krb5_ctx *kctx, u32 offset, | ||
| 84 | struct xdr_buf *buf, int ec, | ||
| 85 | struct page **pages); /* v2 encryption function */ | ||
| 86 | u32 (*decrypt_v2) (struct krb5_ctx *kctx, u32 offset, | ||
| 87 | struct xdr_buf *buf, u32 *headskip, | ||
| 88 | u32 *tailskip); /* v2 decryption function */ | ||
| 89 | }; | ||
| 90 | |||
| 91 | /* krb5_ctx flags definitions */ | ||
| 92 | #define KRB5_CTX_FLAG_INITIATOR 0x00000001 | ||
| 93 | #define KRB5_CTX_FLAG_CFX 0x00000002 | ||
| 94 | #define KRB5_CTX_FLAG_ACCEPTOR_SUBKEY 0x00000004 | ||
| 95 | |||
| 43 | struct krb5_ctx { | 96 | struct krb5_ctx { |
| 44 | int initiate; /* 1 = initiating, 0 = accepting */ | 97 | int initiate; /* 1 = initiating, 0 = accepting */ |
| 98 | u32 enctype; | ||
| 99 | u32 flags; | ||
| 100 | const struct gss_krb5_enctype *gk5e; /* enctype-specific info */ | ||
| 45 | struct crypto_blkcipher *enc; | 101 | struct crypto_blkcipher *enc; |
| 46 | struct crypto_blkcipher *seq; | 102 | struct crypto_blkcipher *seq; |
| 103 | struct crypto_blkcipher *acceptor_enc; | ||
| 104 | struct crypto_blkcipher *initiator_enc; | ||
| 105 | struct crypto_blkcipher *acceptor_enc_aux; | ||
| 106 | struct crypto_blkcipher *initiator_enc_aux; | ||
| 107 | u8 Ksess[GSS_KRB5_MAX_KEYLEN]; /* session key */ | ||
| 108 | u8 cksum[GSS_KRB5_MAX_KEYLEN]; | ||
| 47 | s32 endtime; | 109 | s32 endtime; |
| 48 | u32 seq_send; | 110 | u32 seq_send; |
| 111 | u64 seq_send64; | ||
| 49 | struct xdr_netobj mech_used; | 112 | struct xdr_netobj mech_used; |
| 113 | u8 initiator_sign[GSS_KRB5_MAX_KEYLEN]; | ||
| 114 | u8 acceptor_sign[GSS_KRB5_MAX_KEYLEN]; | ||
| 115 | u8 initiator_seal[GSS_KRB5_MAX_KEYLEN]; | ||
| 116 | u8 acceptor_seal[GSS_KRB5_MAX_KEYLEN]; | ||
| 117 | u8 initiator_integ[GSS_KRB5_MAX_KEYLEN]; | ||
| 118 | u8 acceptor_integ[GSS_KRB5_MAX_KEYLEN]; | ||
| 50 | }; | 119 | }; |
| 51 | 120 | ||
| 52 | extern spinlock_t krb5_seq_lock; | 121 | extern spinlock_t krb5_seq_lock; |
| @@ -57,6 +126,18 @@ extern spinlock_t krb5_seq_lock; | |||
| 57 | #define KG_TOK_MIC_MSG 0x0101 | 126 | #define KG_TOK_MIC_MSG 0x0101 |
| 58 | #define KG_TOK_WRAP_MSG 0x0201 | 127 | #define KG_TOK_WRAP_MSG 0x0201 |
| 59 | 128 | ||
| 129 | #define KG2_TOK_INITIAL 0x0101 | ||
| 130 | #define KG2_TOK_RESPONSE 0x0202 | ||
| 131 | #define KG2_TOK_MIC 0x0404 | ||
| 132 | #define KG2_TOK_WRAP 0x0504 | ||
| 133 | |||
| 134 | #define KG2_TOKEN_FLAG_SENTBYACCEPTOR 0x01 | ||
| 135 | #define KG2_TOKEN_FLAG_SEALED 0x02 | ||
| 136 | #define KG2_TOKEN_FLAG_ACCEPTORSUBKEY 0x04 | ||
| 137 | |||
| 138 | #define KG2_RESP_FLAG_ERROR 0x0001 | ||
| 139 | #define KG2_RESP_FLAG_DELEG_OK 0x0002 | ||
| 140 | |||
| 60 | enum sgn_alg { | 141 | enum sgn_alg { |
| 61 | SGN_ALG_DES_MAC_MD5 = 0x0000, | 142 | SGN_ALG_DES_MAC_MD5 = 0x0000, |
| 62 | SGN_ALG_MD2_5 = 0x0001, | 143 | SGN_ALG_MD2_5 = 0x0001, |
| @@ -81,6 +162,9 @@ enum seal_alg { | |||
| 81 | #define CKSUMTYPE_RSA_MD5_DES 0x0008 | 162 | #define CKSUMTYPE_RSA_MD5_DES 0x0008 |
| 82 | #define CKSUMTYPE_NIST_SHA 0x0009 | 163 | #define CKSUMTYPE_NIST_SHA 0x0009 |
| 83 | #define CKSUMTYPE_HMAC_SHA1_DES3 0x000c | 164 | #define CKSUMTYPE_HMAC_SHA1_DES3 0x000c |
| 165 | #define CKSUMTYPE_HMAC_SHA1_96_AES128 0x000f | ||
| 166 | #define CKSUMTYPE_HMAC_SHA1_96_AES256 0x0010 | ||
| 167 | #define CKSUMTYPE_HMAC_MD5_ARCFOUR -138 /* Microsoft md5 hmac cksumtype */ | ||
| 84 | 168 | ||
| 85 | /* from gssapi_err_krb5.h */ | 169 | /* from gssapi_err_krb5.h */ |
| 86 | #define KG_CCACHE_NOMATCH (39756032L) | 170 | #define KG_CCACHE_NOMATCH (39756032L) |
| @@ -111,11 +195,56 @@ enum seal_alg { | |||
| 111 | #define ENCTYPE_DES3_CBC_RAW 0x0006 /* DES-3 cbc mode raw */ | 195 | #define ENCTYPE_DES3_CBC_RAW 0x0006 /* DES-3 cbc mode raw */ |
| 112 | #define ENCTYPE_DES_HMAC_SHA1 0x0008 | 196 | #define ENCTYPE_DES_HMAC_SHA1 0x0008 |
| 113 | #define ENCTYPE_DES3_CBC_SHA1 0x0010 | 197 | #define ENCTYPE_DES3_CBC_SHA1 0x0010 |
| 198 | #define ENCTYPE_AES128_CTS_HMAC_SHA1_96 0x0011 | ||
| 199 | #define ENCTYPE_AES256_CTS_HMAC_SHA1_96 0x0012 | ||
| 200 | #define ENCTYPE_ARCFOUR_HMAC 0x0017 | ||
| 201 | #define ENCTYPE_ARCFOUR_HMAC_EXP 0x0018 | ||
| 114 | #define ENCTYPE_UNKNOWN 0x01ff | 202 | #define ENCTYPE_UNKNOWN 0x01ff |
| 115 | 203 | ||
| 116 | s32 | 204 | /* |
| 117 | make_checksum(char *, char *header, int hdrlen, struct xdr_buf *body, | 205 | * Constants used for key derivation |
| 118 | int body_offset, struct xdr_netobj *cksum); | 206 | */ |
| 207 | /* for 3DES */ | ||
| 208 | #define KG_USAGE_SEAL (22) | ||
| 209 | #define KG_USAGE_SIGN (23) | ||
| 210 | #define KG_USAGE_SEQ (24) | ||
| 211 | |||
| 212 | /* from rfc3961 */ | ||
| 213 | #define KEY_USAGE_SEED_CHECKSUM (0x99) | ||
| 214 | #define KEY_USAGE_SEED_ENCRYPTION (0xAA) | ||
| 215 | #define KEY_USAGE_SEED_INTEGRITY (0x55) | ||
| 216 | |||
| 217 | /* from rfc4121 */ | ||
| 218 | #define KG_USAGE_ACCEPTOR_SEAL (22) | ||
| 219 | #define KG_USAGE_ACCEPTOR_SIGN (23) | ||
| 220 | #define KG_USAGE_INITIATOR_SEAL (24) | ||
| 221 | #define KG_USAGE_INITIATOR_SIGN (25) | ||
| 222 | |||
| 223 | /* | ||
| 224 | * This compile-time check verifies that we will not exceed the | ||
| 225 | * slack space allotted by the client and server auth_gss code | ||
| 226 | * before they call gss_wrap(). | ||
| 227 | */ | ||
| 228 | #define GSS_KRB5_MAX_SLACK_NEEDED \ | ||
| 229 | (GSS_KRB5_TOK_HDR_LEN /* gss token header */ \ | ||
| 230 | + GSS_KRB5_MAX_CKSUM_LEN /* gss token checksum */ \ | ||
| 231 | + GSS_KRB5_MAX_BLOCKSIZE /* confounder */ \ | ||
| 232 | + GSS_KRB5_MAX_BLOCKSIZE /* possible padding */ \ | ||
| 233 | + GSS_KRB5_TOK_HDR_LEN /* encrypted hdr in v2 token */\ | ||
| 234 | + GSS_KRB5_MAX_CKSUM_LEN /* encryption hmac */ \ | ||
| 235 | + 4 + 4 /* RPC verifier */ \ | ||
| 236 | + GSS_KRB5_TOK_HDR_LEN \ | ||
| 237 | + GSS_KRB5_MAX_CKSUM_LEN) | ||
| 238 | |||
| 239 | u32 | ||
| 240 | make_checksum(struct krb5_ctx *kctx, char *header, int hdrlen, | ||
| 241 | struct xdr_buf *body, int body_offset, u8 *cksumkey, | ||
| 242 | unsigned int usage, struct xdr_netobj *cksumout); | ||
| 243 | |||
| 244 | u32 | ||
| 245 | make_checksum_v2(struct krb5_ctx *, char *header, int hdrlen, | ||
| 246 | struct xdr_buf *body, int body_offset, u8 *key, | ||
| 247 | unsigned int usage, struct xdr_netobj *cksum); | ||
| 119 | 248 | ||
| 120 | u32 gss_get_mic_kerberos(struct gss_ctx *, struct xdr_buf *, | 249 | u32 gss_get_mic_kerberos(struct gss_ctx *, struct xdr_buf *, |
| 121 | struct xdr_netobj *); | 250 | struct xdr_netobj *); |
| @@ -149,11 +278,54 @@ gss_decrypt_xdr_buf(struct crypto_blkcipher *tfm, struct xdr_buf *inbuf, | |||
| 149 | int offset); | 278 | int offset); |
| 150 | 279 | ||
| 151 | s32 | 280 | s32 |
| 152 | krb5_make_seq_num(struct crypto_blkcipher *key, | 281 | krb5_make_seq_num(struct krb5_ctx *kctx, |
| 282 | struct crypto_blkcipher *key, | ||
| 153 | int direction, | 283 | int direction, |
| 154 | u32 seqnum, unsigned char *cksum, unsigned char *buf); | 284 | u32 seqnum, unsigned char *cksum, unsigned char *buf); |
| 155 | 285 | ||
| 156 | s32 | 286 | s32 |
| 157 | krb5_get_seq_num(struct crypto_blkcipher *key, | 287 | krb5_get_seq_num(struct krb5_ctx *kctx, |
| 158 | unsigned char *cksum, | 288 | unsigned char *cksum, |
| 159 | unsigned char *buf, int *direction, u32 *seqnum); | 289 | unsigned char *buf, int *direction, u32 *seqnum); |
| 290 | |||
| 291 | int | ||
| 292 | xdr_extend_head(struct xdr_buf *buf, unsigned int base, unsigned int shiftlen); | ||
| 293 | |||
| 294 | u32 | ||
| 295 | krb5_derive_key(const struct gss_krb5_enctype *gk5e, | ||
| 296 | const struct xdr_netobj *inkey, | ||
| 297 | struct xdr_netobj *outkey, | ||
| 298 | const struct xdr_netobj *in_constant, | ||
| 299 | gfp_t gfp_mask); | ||
| 300 | |||
| 301 | u32 | ||
| 302 | gss_krb5_des3_make_key(const struct gss_krb5_enctype *gk5e, | ||
| 303 | struct xdr_netobj *randombits, | ||
| 304 | struct xdr_netobj *key); | ||
| 305 | |||
| 306 | u32 | ||
| 307 | gss_krb5_aes_make_key(const struct gss_krb5_enctype *gk5e, | ||
| 308 | struct xdr_netobj *randombits, | ||
| 309 | struct xdr_netobj *key); | ||
| 310 | |||
| 311 | u32 | ||
| 312 | gss_krb5_aes_encrypt(struct krb5_ctx *kctx, u32 offset, | ||
| 313 | struct xdr_buf *buf, int ec, | ||
| 314 | struct page **pages); | ||
| 315 | |||
| 316 | u32 | ||
| 317 | gss_krb5_aes_decrypt(struct krb5_ctx *kctx, u32 offset, | ||
| 318 | struct xdr_buf *buf, u32 *plainoffset, | ||
| 319 | u32 *plainlen); | ||
| 320 | |||
| 321 | int | ||
| 322 | krb5_rc4_setup_seq_key(struct krb5_ctx *kctx, | ||
| 323 | struct crypto_blkcipher *cipher, | ||
| 324 | unsigned char *cksum); | ||
| 325 | |||
| 326 | int | ||
| 327 | krb5_rc4_setup_enc_key(struct krb5_ctx *kctx, | ||
| 328 | struct crypto_blkcipher *cipher, | ||
| 329 | s32 seqnum); | ||
| 330 | void | ||
| 331 | gss_krb5_make_confounder(char *p, u32 conflen); | ||
diff --git a/include/linux/sunrpc/metrics.h b/include/linux/sunrpc/metrics.h index 77f78e56c481..b6edbc0ea83d 100644 --- a/include/linux/sunrpc/metrics.h +++ b/include/linux/sunrpc/metrics.h | |||
| @@ -26,6 +26,7 @@ | |||
| 26 | #define _LINUX_SUNRPC_METRICS_H | 26 | #define _LINUX_SUNRPC_METRICS_H |
| 27 | 27 | ||
| 28 | #include <linux/seq_file.h> | 28 | #include <linux/seq_file.h> |
| 29 | #include <linux/ktime.h> | ||
| 29 | 30 | ||
| 30 | #define RPC_IOSTATS_VERS "1.0" | 31 | #define RPC_IOSTATS_VERS "1.0" |
| 31 | 32 | ||
| @@ -58,9 +59,9 @@ struct rpc_iostats { | |||
| 58 | * and the total time the request spent from init to release | 59 | * and the total time the request spent from init to release |
| 59 | * are measured. | 60 | * are measured. |
| 60 | */ | 61 | */ |
| 61 | unsigned long long om_queue, /* jiffies queued for xmit */ | 62 | ktime_t om_queue, /* queued for xmit */ |
| 62 | om_rtt, /* jiffies for RPC RTT */ | 63 | om_rtt, /* RPC RTT */ |
| 63 | om_execute; /* jiffies for RPC execution */ | 64 | om_execute; /* RPC execution */ |
| 64 | } ____cacheline_aligned; | 65 | } ____cacheline_aligned; |
| 65 | 66 | ||
| 66 | struct rpc_task; | 67 | struct rpc_task; |
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h index 7bc7fd5291ce..88513fd8e208 100644 --- a/include/linux/sunrpc/sched.h +++ b/include/linux/sunrpc/sched.h | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | #define _LINUX_SUNRPC_SCHED_H_ | 10 | #define _LINUX_SUNRPC_SCHED_H_ |
| 11 | 11 | ||
| 12 | #include <linux/timer.h> | 12 | #include <linux/timer.h> |
| 13 | #include <linux/ktime.h> | ||
| 13 | #include <linux/sunrpc/types.h> | 14 | #include <linux/sunrpc/types.h> |
| 14 | #include <linux/spinlock.h> | 15 | #include <linux/spinlock.h> |
| 15 | #include <linux/wait.h> | 16 | #include <linux/wait.h> |
| @@ -40,21 +41,15 @@ struct rpc_wait { | |||
| 40 | * This is the RPC task struct | 41 | * This is the RPC task struct |
| 41 | */ | 42 | */ |
| 42 | struct rpc_task { | 43 | struct rpc_task { |
| 43 | #ifdef RPC_DEBUG | ||
| 44 | unsigned long tk_magic; /* 0xf00baa */ | ||
| 45 | #endif | ||
| 46 | atomic_t tk_count; /* Reference count */ | 44 | atomic_t tk_count; /* Reference count */ |
| 47 | struct list_head tk_task; /* global list of tasks */ | 45 | struct list_head tk_task; /* global list of tasks */ |
| 48 | struct rpc_clnt * tk_client; /* RPC client */ | 46 | struct rpc_clnt * tk_client; /* RPC client */ |
| 49 | struct rpc_rqst * tk_rqstp; /* RPC request */ | 47 | struct rpc_rqst * tk_rqstp; /* RPC request */ |
| 50 | int tk_status; /* result of last operation */ | ||
| 51 | 48 | ||
| 52 | /* | 49 | /* |
| 53 | * RPC call state | 50 | * RPC call state |
| 54 | */ | 51 | */ |
| 55 | struct rpc_message tk_msg; /* RPC call info */ | 52 | struct rpc_message tk_msg; /* RPC call info */ |
| 56 | __u8 tk_garb_retry; | ||
| 57 | __u8 tk_cred_retry; | ||
| 58 | 53 | ||
| 59 | /* | 54 | /* |
| 60 | * callback to be executed after waking up | 55 | * callback to be executed after waking up |
| @@ -67,7 +62,6 @@ struct rpc_task { | |||
| 67 | void * tk_calldata; | 62 | void * tk_calldata; |
| 68 | 63 | ||
| 69 | unsigned long tk_timeout; /* timeout for rpc_sleep() */ | 64 | unsigned long tk_timeout; /* timeout for rpc_sleep() */ |
| 70 | unsigned short tk_flags; /* misc flags */ | ||
| 71 | unsigned long tk_runstate; /* Task run status */ | 65 | unsigned long tk_runstate; /* Task run status */ |
| 72 | struct workqueue_struct *tk_workqueue; /* Normally rpciod, but could | 66 | struct workqueue_struct *tk_workqueue; /* Normally rpciod, but could |
| 73 | * be any workqueue | 67 | * be any workqueue |
| @@ -78,17 +72,19 @@ struct rpc_task { | |||
| 78 | struct rpc_wait tk_wait; /* RPC wait */ | 72 | struct rpc_wait tk_wait; /* RPC wait */ |
| 79 | } u; | 73 | } u; |
| 80 | 74 | ||
| 81 | unsigned short tk_timeouts; /* maj timeouts */ | 75 | ktime_t tk_start; /* RPC task init timestamp */ |
| 82 | size_t tk_bytes_sent; /* total bytes sent */ | ||
| 83 | unsigned long tk_start; /* RPC task init timestamp */ | ||
| 84 | long tk_rtt; /* round-trip time (jiffies) */ | ||
| 85 | 76 | ||
| 86 | pid_t tk_owner; /* Process id for batching tasks */ | 77 | pid_t tk_owner; /* Process id for batching tasks */ |
| 87 | unsigned char tk_priority : 2;/* Task priority */ | 78 | int tk_status; /* result of last operation */ |
| 79 | unsigned short tk_flags; /* misc flags */ | ||
| 80 | unsigned short tk_timeouts; /* maj timeouts */ | ||
| 88 | 81 | ||
| 89 | #ifdef RPC_DEBUG | 82 | #ifdef RPC_DEBUG |
| 90 | unsigned short tk_pid; /* debugging aid */ | 83 | unsigned short tk_pid; /* debugging aid */ |
| 91 | #endif | 84 | #endif |
| 85 | unsigned char tk_priority : 2,/* Task priority */ | ||
| 86 | tk_garb_retry : 2, | ||
| 87 | tk_cred_retry : 2; | ||
| 92 | }; | 88 | }; |
| 93 | #define tk_xprt tk_client->cl_xprt | 89 | #define tk_xprt tk_client->cl_xprt |
| 94 | 90 | ||
| @@ -217,6 +213,7 @@ struct rpc_task *rpc_run_bc_task(struct rpc_rqst *req, | |||
| 217 | const struct rpc_call_ops *ops); | 213 | const struct rpc_call_ops *ops); |
| 218 | void rpc_put_task(struct rpc_task *); | 214 | void rpc_put_task(struct rpc_task *); |
| 219 | void rpc_exit_task(struct rpc_task *); | 215 | void rpc_exit_task(struct rpc_task *); |
| 216 | void rpc_exit(struct rpc_task *, int); | ||
| 220 | void rpc_release_calldata(const struct rpc_call_ops *, void *); | 217 | void rpc_release_calldata(const struct rpc_call_ops *, void *); |
| 221 | void rpc_killall_tasks(struct rpc_clnt *); | 218 | void rpc_killall_tasks(struct rpc_clnt *); |
| 222 | void rpc_execute(struct rpc_task *); | 219 | void rpc_execute(struct rpc_task *); |
| @@ -245,12 +242,6 @@ void rpc_destroy_mempool(void); | |||
| 245 | extern struct workqueue_struct *rpciod_workqueue; | 242 | extern struct workqueue_struct *rpciod_workqueue; |
| 246 | void rpc_prepare_task(struct rpc_task *task); | 243 | void rpc_prepare_task(struct rpc_task *task); |
| 247 | 244 | ||
| 248 | static inline void rpc_exit(struct rpc_task *task, int status) | ||
| 249 | { | ||
| 250 | task->tk_status = status; | ||
| 251 | task->tk_action = rpc_exit_task; | ||
| 252 | } | ||
| 253 | |||
| 254 | static inline int rpc_wait_for_completion_task(struct rpc_task *task) | 245 | static inline int rpc_wait_for_completion_task(struct rpc_task *task) |
| 255 | { | 246 | { |
| 256 | return __rpc_wait_for_completion_task(task, NULL); | 247 | return __rpc_wait_for_completion_task(task, NULL); |
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h index f5cc0898bc53..35cf2e8cd7c6 100644 --- a/include/linux/sunrpc/xdr.h +++ b/include/linux/sunrpc/xdr.h | |||
| @@ -1,7 +1,10 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * include/linux/sunrpc/xdr.h | 2 | * XDR standard data types and function declarations |
| 3 | * | 3 | * |
| 4 | * Copyright (C) 1995-1997 Olaf Kirch <okir@monad.swb.de> | 4 | * Copyright (C) 1995-1997 Olaf Kirch <okir@monad.swb.de> |
| 5 | * | ||
| 6 | * Based on: | ||
| 7 | * RFC 4506 "XDR: External Data Representation Standard", May 2006 | ||
| 5 | */ | 8 | */ |
| 6 | 9 | ||
| 7 | #ifndef _SUNRPC_XDR_H_ | 10 | #ifndef _SUNRPC_XDR_H_ |
| @@ -62,7 +65,6 @@ struct xdr_buf { | |||
| 62 | 65 | ||
| 63 | unsigned int buflen, /* Total length of storage buffer */ | 66 | unsigned int buflen, /* Total length of storage buffer */ |
| 64 | len; /* Length of XDR encoded message */ | 67 | len; /* Length of XDR encoded message */ |
| 65 | |||
| 66 | }; | 68 | }; |
| 67 | 69 | ||
| 68 | /* | 70 | /* |
| @@ -178,7 +180,7 @@ struct xdr_array2_desc { | |||
| 178 | }; | 180 | }; |
| 179 | 181 | ||
| 180 | extern int xdr_decode_array2(struct xdr_buf *buf, unsigned int base, | 182 | extern int xdr_decode_array2(struct xdr_buf *buf, unsigned int base, |
| 181 | struct xdr_array2_desc *desc); | 183 | struct xdr_array2_desc *desc); |
| 182 | extern int xdr_encode_array2(struct xdr_buf *buf, unsigned int base, | 184 | extern int xdr_encode_array2(struct xdr_buf *buf, unsigned int base, |
| 183 | struct xdr_array2_desc *desc); | 185 | struct xdr_array2_desc *desc); |
| 184 | 186 | ||
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h index 6f9457a75b8f..ff5a77b28c50 100644 --- a/include/linux/sunrpc/xprt.h +++ b/include/linux/sunrpc/xprt.h | |||
| @@ -13,6 +13,7 @@ | |||
| 13 | #include <linux/socket.h> | 13 | #include <linux/socket.h> |
| 14 | #include <linux/in.h> | 14 | #include <linux/in.h> |
| 15 | #include <linux/kref.h> | 15 | #include <linux/kref.h> |
| 16 | #include <linux/ktime.h> | ||
| 16 | #include <linux/sunrpc/sched.h> | 17 | #include <linux/sunrpc/sched.h> |
| 17 | #include <linux/sunrpc/xdr.h> | 18 | #include <linux/sunrpc/xdr.h> |
| 18 | #include <linux/sunrpc/msg_prot.h> | 19 | #include <linux/sunrpc/msg_prot.h> |
| @@ -63,10 +64,9 @@ struct rpc_rqst { | |||
| 63 | * This is the private part | 64 | * This is the private part |
| 64 | */ | 65 | */ |
| 65 | struct rpc_task * rq_task; /* RPC task data */ | 66 | struct rpc_task * rq_task; /* RPC task data */ |
| 67 | struct rpc_cred * rq_cred; /* Bound cred */ | ||
| 66 | __be32 rq_xid; /* request XID */ | 68 | __be32 rq_xid; /* request XID */ |
| 67 | int rq_cong; /* has incremented xprt->cong */ | 69 | int rq_cong; /* has incremented xprt->cong */ |
| 68 | int rq_reply_bytes_recvd; /* number of reply */ | ||
| 69 | /* bytes received */ | ||
| 70 | u32 rq_seqno; /* gss seq no. used on req. */ | 70 | u32 rq_seqno; /* gss seq no. used on req. */ |
| 71 | int rq_enc_pages_num; | 71 | int rq_enc_pages_num; |
| 72 | struct page **rq_enc_pages; /* scratch pages for use by | 72 | struct page **rq_enc_pages; /* scratch pages for use by |
| @@ -77,12 +77,16 @@ struct rpc_rqst { | |||
| 77 | __u32 * rq_buffer; /* XDR encode buffer */ | 77 | __u32 * rq_buffer; /* XDR encode buffer */ |
| 78 | size_t rq_callsize, | 78 | size_t rq_callsize, |
| 79 | rq_rcvsize; | 79 | rq_rcvsize; |
| 80 | size_t rq_xmit_bytes_sent; /* total bytes sent */ | ||
| 81 | size_t rq_reply_bytes_recvd; /* total reply bytes */ | ||
| 82 | /* received */ | ||
| 80 | 83 | ||
| 81 | struct xdr_buf rq_private_buf; /* The receive buffer | 84 | struct xdr_buf rq_private_buf; /* The receive buffer |
| 82 | * used in the softirq. | 85 | * used in the softirq. |
| 83 | */ | 86 | */ |
| 84 | unsigned long rq_majortimeo; /* major timeout alarm */ | 87 | unsigned long rq_majortimeo; /* major timeout alarm */ |
| 85 | unsigned long rq_timeout; /* Current timeout value */ | 88 | unsigned long rq_timeout; /* Current timeout value */ |
| 89 | ktime_t rq_rtt; /* round-trip time */ | ||
| 86 | unsigned int rq_retries; /* # of retries */ | 90 | unsigned int rq_retries; /* # of retries */ |
| 87 | unsigned int rq_connect_cookie; | 91 | unsigned int rq_connect_cookie; |
| 88 | /* A cookie used to track the | 92 | /* A cookie used to track the |
| @@ -94,7 +98,7 @@ struct rpc_rqst { | |||
| 94 | */ | 98 | */ |
| 95 | u32 rq_bytes_sent; /* Bytes we have sent */ | 99 | u32 rq_bytes_sent; /* Bytes we have sent */ |
| 96 | 100 | ||
| 97 | unsigned long rq_xtime; /* when transmitted */ | 101 | ktime_t rq_xtime; /* transmit time stamp */ |
| 98 | int rq_ntrans; | 102 | int rq_ntrans; |
| 99 | 103 | ||
| 100 | #if defined(CONFIG_NFS_V4_1) | 104 | #if defined(CONFIG_NFS_V4_1) |
| @@ -174,8 +178,7 @@ struct rpc_xprt { | |||
| 174 | /* | 178 | /* |
| 175 | * Connection of transports | 179 | * Connection of transports |
| 176 | */ | 180 | */ |
| 177 | unsigned long connect_timeout, | 181 | unsigned long bind_timeout, |
| 178 | bind_timeout, | ||
| 179 | reestablish_timeout; | 182 | reestablish_timeout; |
| 180 | unsigned int connect_cookie; /* A cookie that gets bumped | 183 | unsigned int connect_cookie; /* A cookie that gets bumped |
| 181 | every time the transport | 184 | every time the transport |
| @@ -294,7 +297,6 @@ void xprt_set_retrans_timeout_rtt(struct rpc_task *task); | |||
| 294 | void xprt_wake_pending_tasks(struct rpc_xprt *xprt, int status); | 297 | void xprt_wake_pending_tasks(struct rpc_xprt *xprt, int status); |
| 295 | void xprt_wait_for_buffer_space(struct rpc_task *task, rpc_action action); | 298 | void xprt_wait_for_buffer_space(struct rpc_task *task, rpc_action action); |
| 296 | void xprt_write_space(struct rpc_xprt *xprt); | 299 | void xprt_write_space(struct rpc_xprt *xprt); |
| 297 | void xprt_update_rtt(struct rpc_task *task); | ||
| 298 | void xprt_adjust_cwnd(struct rpc_task *task, int result); | 300 | void xprt_adjust_cwnd(struct rpc_task *task, int result); |
| 299 | struct rpc_rqst * xprt_lookup_rqst(struct rpc_xprt *xprt, __be32 xid); | 301 | struct rpc_rqst * xprt_lookup_rqst(struct rpc_xprt *xprt, __be32 xid); |
| 300 | void xprt_complete_rqst(struct rpc_task *task, int copied); | 302 | void xprt_complete_rqst(struct rpc_task *task, int copied); |
