Pull NFS client updates from Trond Myklebust: "Highlights include: Stable fixes: - Fixes for NFS I/O request leakages - Fix error handling paths in the NFS I/O recoalescing code - Reinitialise NFSv4.1 sequence results before retransmitting a request - Fix a soft lockup in the delegation recovery code - Bulk destroy of layouts needs to be safe w.r.t. umount - Prevent thundering herd issues when the SUNRPC socket is not connected - Respect RPC call timeouts when retrying transmission Features: - Convert rpc auth layer to use xdr_streams - Config option to disable insecure RPCSEC_GSS crypto types - Reduce size of RPC receive buffers - Readdirplus optimization by cache mechanism - Convert SUNRPC socket send code to use iov_iter() - SUNRPC micro-optimisations to avoid indirect calls - Add support for the pNFS LAYOUTERROR operation and use it with the pNFS/flexfiles driver - Add trace events to report non-zero NFS status codes - Various removals of unnecessary dprintks Bugfixes and cleanups: - Fix a number of sparse warnings and documentation format warnings - Fix nfs_parse_devname to not modify it's argument - Fix potential corruption of page being written through pNFS/blocks - fix xfstest generic/099 failures on nfsv3 - Avoid NFSv4.1 "false retries" when RPC calls are interrupted - Abort I/O early if the pNFS/flexfiles layout segment was invalidated - Avoid unnecessary pNFS/flexfiles layout invalidations" * tag 'nfs-for-5.1-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: (90 commits) SUNRPC: Take the transport send lock before binding+connecting SUNRPC: Micro-optimise when the task is known not to be sleeping SUNRPC: Check whether the task was transmitted before rebind/reconnect SUNRPC: Remove redundant calls to RPC_IS_QUEUED() SUNRPC: Clean up SUNRPC: Respect RPC call timeouts when retrying transmission SUNRPC: Fix up RPC back channel transmission SUNRPC: Prevent thundering herd when the socket is not connected SUNRPC: Allow dynamic allocation of back channel slots NFSv4.1: Bump the default callback session slot count to 16 SUNRPC: Convert remaining GFP_NOIO, and GFP_NOWAIT sites in sunrpc NFS/flexfiles: Clean up mirror DS initialisation NFS/flexfiles: Remove dead code in ff_layout_mirror_valid() NFS/flexfile: Simplify nfs4_ff_layout_select_ds_stateid() NFS/flexfile: Simplify nfs4_ff_layout_ds_version() NFS/flexfiles: Simplify ff_layout_get_ds_cred() NFS/flexfiles: Simplify nfs4_ff_find_or_create_ds_client() NFS/flexfiles: Simplify nfs4_ff_layout_select_ds_fh() NFS/flexfiles: Speed up read failover when DSes are down NFS/flexfiles: Don't invalidate DS deviceids for being unresponsive ...
Showing the changes to include/linux (11 of 83 files). Show all
Unified · Split
| @@ -538,6 +538,7 @@ enum { · 537 unmodified lines | |||
| 538 | NFSPROC4_CLNT_OFFLOAD_CANCEL, | 538 | NFSPROC4_CLNT_OFFLOAD_CANCEL, |
| 539 | 539 | ||
| 540 | NFSPROC4_CLNT_LOOKUPP, | 540 | NFSPROC4_CLNT_LOOKUPP, |
| 541 | NFSPROC4_CLNT_LAYOUTERROR, | ||
| 541 | }; | 542 | }; |
| 542 | 543 | ||
| 543 | /* nfs41 types */ | 544 | /* nfs41 types */ |
| @@ -261,5 +261,6 @@ struct nfs_server { · 260 unmodified lines | |||
| 261 | #define NFS_CAP_CLONE (1U << 23) | 261 | #define NFS_CAP_CLONE (1U << 23) |
| 262 | #define NFS_CAP_COPY (1U << 24) | 262 | #define NFS_CAP_COPY (1U << 24) |
| 263 | #define NFS_CAP_OFFLOAD_CANCEL (1U << 25) | 263 | #define NFS_CAP_OFFLOAD_CANCEL (1U << 25) |
| 264 | #define NFS_CAP_LAYOUTERROR (1U << 26) | ||
| 264 | 265 | ||
| 265 | #endif | 266 | #endif |
| @@ -164,6 +164,16 @@ nfs_list_add_request(struct nfs_page *req, struct list_head *head) · 163 unmodified lines | |||
| 164 | list_add_tail(&req->wb_list, head); | 164 | list_add_tail(&req->wb_list, head); |
| 165 | } | 165 | } |
| 166 | 166 | ||
| 167 | /** | ||
| 168 | * nfs_list_move_request - Move a request to a new list | ||
| 169 | * @req: request | ||
| 170 | * @head: head of list into which to insert the request. | ||
| 171 | */ | ||
| 172 | static inline void | ||
| 173 | nfs_list_move_request(struct nfs_page *req, struct list_head *head) | ||
| 174 | { | ||
| 175 | list_move_tail(&req->wb_list, head); | ||
| 176 | } | ||
| 167 | 177 | ||
| 168 | /** | 178 | /** |
| 169 | * nfs_list_remove_request - Remove a request from its wb_list | 179 | * nfs_list_remove_request - Remove a request from its wb_list |
| @@ -383,6 +383,41 @@ struct nfs42_layoutstat_data { · 382 unmodified lines | |||
| 383 | struct nfs42_layoutstat_res res; | 383 | struct nfs42_layoutstat_res res; |
| 384 | }; | 384 | }; |
| 385 | 385 | ||
| 386 | struct nfs42_device_error { | ||
| 387 | struct nfs4_deviceid dev_id; | ||
| 388 | int status; | ||
| 389 | enum nfs_opnum4 opnum; | ||
| 390 | }; | ||
| 391 | |||
| 392 | struct nfs42_layout_error { | ||
| 393 | __u64 offset; | ||
| 394 | __u64 length; | ||
| 395 | nfs4_stateid stateid; | ||
| 396 | struct nfs42_device_error errors[1]; | ||
| 397 | }; | ||
| 398 | |||
| 399 | #define NFS42_LAYOUTERROR_MAX 5 | ||
| 400 | |||
| 401 | struct nfs42_layouterror_args { | ||
| 402 | struct nfs4_sequence_args seq_args; | ||
| 403 | struct inode *inode; | ||
| 404 | unsigned int num_errors; | ||
| 405 | struct nfs42_layout_error errors[NFS42_LAYOUTERROR_MAX]; | ||
| 406 | }; | ||
| 407 | |||
| 408 | struct nfs42_layouterror_res { | ||
| 409 | struct nfs4_sequence_res seq_res; | ||
| 410 | unsigned int num_errors; | ||
| 411 | int rpc_status; | ||
| 412 | }; | ||
| 413 | |||
| 414 | struct nfs42_layouterror_data { | ||
| 415 | struct nfs42_layouterror_args args; | ||
| 416 | struct nfs42_layouterror_res res; | ||
| 417 | struct inode *inode; | ||
| 418 | struct pnfs_layout_segment *lseg; | ||
| 419 | }; | ||
| 420 | |||
| 386 | struct nfs42_clone_args { | 421 | struct nfs42_clone_args { |
| 387 | struct nfs4_sequence_args seq_args; | 422 | struct nfs4_sequence_args seq_args; |
| 388 | struct nfs_fh *src_fh; | 423 | struct nfs_fh *src_fh; |
| @@ -1549,7 +1584,7 @@ struct nfs_commit_data { · 1160 unmodified lines | |||
| 1549 | }; | 1584 | }; |
| 1550 | 1585 | ||
| 1551 | struct nfs_pgio_completion_ops { | 1586 | struct nfs_pgio_completion_ops { |
| 1552 | void (*error_cleanup)(struct list_head *head); | 1587 | void (*error_cleanup)(struct list_head *head, int); |
| 1553 | void (*init_hdr)(struct nfs_pgio_header *hdr); | 1588 | void (*init_hdr)(struct nfs_pgio_header *hdr); |
| 1554 | void (*completion)(struct nfs_pgio_header *hdr); | 1589 | void (*completion)(struct nfs_pgio_header *hdr); |
| 1555 | void (*reschedule_io)(struct nfs_pgio_header *hdr); | 1590 | void (*reschedule_io)(struct nfs_pgio_header *hdr); |
| @@ -74,14 +74,12 @@ struct rpc_cred_cache; · 73 unmodified lines | |||
| 74 | struct rpc_authops; | 74 | struct rpc_authops; |
| 75 | struct rpc_auth { | 75 | struct rpc_auth { |
| 76 | unsigned int au_cslack; /* call cred size estimate */ | 76 | unsigned int au_cslack; /* call cred size estimate */ |
| 77 | /* guess at number of u32's auth adds before | 77 | unsigned int au_rslack; /* reply cred size estimate */ |
| 78 | * reply data; normally the verifier size: */ | 78 | unsigned int au_verfsize; /* size of reply verifier */ |
| 79 | unsigned int au_rslack; | 79 | unsigned int au_ralign; /* words before UL header */ |
| 80 | /* for gss, used to calculate au_rslack: */ | 80 | |
| 81 | unsigned int au_verfsize; | 81 | unsigned int au_flags; |
| 82 | 82 | const struct rpc_authops *au_ops; | |
| 83 | unsigned int au_flags; /* various flags */ | ||
| 84 | const struct rpc_authops *au_ops; /* operations */ | ||
| 85 | rpc_authflavor_t au_flavor; /* pseudoflavor (note may | 83 | rpc_authflavor_t au_flavor; /* pseudoflavor (note may |
| 86 | * differ from the flavor in | 84 | * differ from the flavor in |
| 87 | * au_ops->au_flavor in gss | 85 | * au_ops->au_flavor in gss |
| @@ -131,13 +129,15 @@ struct rpc_credops { · 43 unmodified lines | |||
| 131 | void (*crdestroy)(struct rpc_cred *); | 129 | void (*crdestroy)(struct rpc_cred *); |
| 132 | 130 | ||
| 133 | int (*crmatch)(struct auth_cred *, struct rpc_cred *, int); | 131 | int (*crmatch)(struct auth_cred *, struct rpc_cred *, int); |
| 134 | __be32 * (*crmarshal)(struct rpc_task *, __be32 *); | 132 | int (*crmarshal)(struct rpc_task *task, |
| 133 | struct xdr_stream *xdr); | ||
| 135 | int (*crrefresh)(struct rpc_task *); | 134 | int (*crrefresh)(struct rpc_task *); |
| 136 | __be32 * (*crvalidate)(struct rpc_task *, __be32 *); | 135 | int (*crvalidate)(struct rpc_task *task, |
| 137 | int (*crwrap_req)(struct rpc_task *, kxdreproc_t, | 136 | struct xdr_stream *xdr); |
| 138 | void *, __be32 *, void *); | 137 | int (*crwrap_req)(struct rpc_task *task, |
| 139 | int (*crunwrap_resp)(struct rpc_task *, kxdrdproc_t, | 138 | struct xdr_stream *xdr); |
| 140 | void *, __be32 *, void *); | 139 | int (*crunwrap_resp)(struct rpc_task *task, |
| 140 | struct xdr_stream *xdr); | ||
| 141 | int (*crkey_timeout)(struct rpc_cred *); | 141 | int (*crkey_timeout)(struct rpc_cred *); |
| 142 | char * (*crstringify_acceptor)(struct rpc_cred *); | 142 | char * (*crstringify_acceptor)(struct rpc_cred *); |
| 143 | bool (*crneed_reencode)(struct rpc_task *); | 143 | bool (*crneed_reencode)(struct rpc_task *); |
| @@ -165,10 +165,18 @@ struct rpc_cred * rpcauth_lookup_credcache(struct rpc_auth *, struct auth_cred * · 21 unmodified lines | |||
| 165 | void rpcauth_init_cred(struct rpc_cred *, const struct auth_cred *, struct rpc_auth *, const struct rpc_credops *); | 165 | void rpcauth_init_cred(struct rpc_cred *, const struct auth_cred *, struct rpc_auth *, const struct rpc_credops *); |
| 166 | struct rpc_cred * rpcauth_lookupcred(struct rpc_auth *, int); | 166 | struct rpc_cred * rpcauth_lookupcred(struct rpc_auth *, int); |
| 167 | void put_rpccred(struct rpc_cred *); | 167 | void put_rpccred(struct rpc_cred *); |
| 168 | __be32 * rpcauth_marshcred(struct rpc_task *, __be32 *); | 168 | int rpcauth_marshcred(struct rpc_task *task, |
| 169 | __be32 * rpcauth_checkverf(struct rpc_task *, __be32 *); | 169 | struct xdr_stream *xdr); |
| 170 | int rpcauth_wrap_req(struct rpc_task *task, kxdreproc_t encode, void *rqstp, __be32 *data, void *obj); | 170 | int rpcauth_checkverf(struct rpc_task *task, |
| 171 | int rpcauth_unwrap_resp(struct rpc_task *task, kxdrdproc_t decode, void *rqstp, __be32 *data, void *obj); | 171 | struct xdr_stream *xdr); |
| 172 | int rpcauth_wrap_req_encode(struct rpc_task *task, | ||
| 173 | struct xdr_stream *xdr); | ||
| 174 | int rpcauth_wrap_req(struct rpc_task *task, | ||
| 175 | struct xdr_stream *xdr); | ||
| 176 | int rpcauth_unwrap_resp_decode(struct rpc_task *task, | ||
| 177 | struct xdr_stream *xdr); | ||
| 178 | int rpcauth_unwrap_resp(struct rpc_task *task, | ||
| 179 | struct xdr_stream *xdr); | ||
| 172 | bool rpcauth_xmit_need_reencode(struct rpc_task *task); | 180 | bool rpcauth_xmit_need_reencode(struct rpc_task *task); |
| 173 | int rpcauth_refreshcred(struct rpc_task *); | 181 | int rpcauth_refreshcred(struct rpc_task *); |
| 174 | void rpcauth_invalcred(struct rpc_task *); | 182 | void rpcauth_invalcred(struct rpc_task *); |
| @@ -169,6 +169,9 @@ int rpcb_v4_register(struct net *net, const u32 program, · 168 unmodified lines | |||
| 169 | const char *netid); | 169 | const char *netid); |
| 170 | void rpcb_getport_async(struct rpc_task *); | 170 | void rpcb_getport_async(struct rpc_task *); |
| 171 | 171 | ||
| 172 | void rpc_prepare_reply_pages(struct rpc_rqst *req, struct page **pages, | ||
| 173 | unsigned int base, unsigned int len, | ||
| 174 | unsigned int hdrsize); | ||
| 172 | void rpc_call_start(struct rpc_task *); | 175 | void rpc_call_start(struct rpc_task *); |
| 173 | int rpc_call_async(struct rpc_clnt *clnt, | 176 | int rpc_call_async(struct rpc_clnt *clnt, |
| 174 | const struct rpc_message *msg, int flags, | 177 | const struct rpc_message *msg, int flags, |
| @@ -1,4 +1,44 @@ | |||
| 1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
| 1 | /* | 2 | /* |
| 2 | * Dumb way to share this static piece of information with nfsd | 3 | * Define the string that exports the set of kernel-supported |
| 4 | * Kerberos enctypes. This list is sent via upcall to gssd, and | ||
| 5 | * is also exposed via the nfsd /proc API. The consumers generally | ||
| 6 | * treat this as an ordered list, where the first item in the list | ||
| 7 | * is the most preferred. | ||
| 8 | */ | ||
| 9 | |||
| 10 | #ifndef _LINUX_SUNRPC_GSS_KRB5_ENCTYPES_H | ||
| 11 | #define _LINUX_SUNRPC_GSS_KRB5_ENCTYPES_H | ||
| 12 | |||
| 13 | #ifdef CONFIG_SUNRPC_DISABLE_INSECURE_ENCTYPES | ||
| 14 | |||
| 15 | /* | ||
| 16 | * NB: This list includes encryption types that were deprecated | ||
| 17 | * by RFC 8429 (DES3_CBC_SHA1 and ARCFOUR_HMAC). | ||
| 18 | * | ||
| 19 | * ENCTYPE_AES256_CTS_HMAC_SHA1_96 | ||
| 20 | * ENCTYPE_AES128_CTS_HMAC_SHA1_96 | ||
| 21 | * ENCTYPE_DES3_CBC_SHA1 | ||
| 22 | * ENCTYPE_ARCFOUR_HMAC | ||
| 23 | */ | ||
| 24 | #define KRB5_SUPPORTED_ENCTYPES "18,17,16,23" | ||
| 25 | |||
| 26 | #else /* CONFIG_SUNRPC_DISABLE_INSECURE_ENCTYPES */ | ||
| 27 | |||
| 28 | /* | ||
| 29 | * NB: This list includes encryption types that were deprecated | ||
| 30 | * by RFC 8429 and RFC 6649. | ||
| 31 | * | ||
| 32 | * ENCTYPE_AES256_CTS_HMAC_SHA1_96 | ||
| 33 | * ENCTYPE_AES128_CTS_HMAC_SHA1_96 | ||
| 34 | * ENCTYPE_DES3_CBC_SHA1 | ||
| 35 | * ENCTYPE_ARCFOUR_HMAC | ||
| 36 | * ENCTYPE_DES_CBC_MD5 | ||
| 37 | * ENCTYPE_DES_CBC_CRC | ||
| 38 | * ENCTYPE_DES_CBC_MD4 | ||
| 3 | */ | 39 | */ |
| 4 | #define KRB5_SUPPORTED_ENCTYPES "18,17,16,23,3,1,2" | 40 | #define KRB5_SUPPORTED_ENCTYPES "18,17,16,23,3,1,2" |
| 41 | |||
| 42 | #endif /* CONFIG_SUNRPC_DISABLE_INSECURE_ENCTYPES */ | ||
| 43 | |||
| 44 | #endif /* _LINUX_SUNRPC_GSS_KRB5_ENCTYPES_H */ | ||
| @@ -97,6 +97,7 @@ typedef void (*rpc_action)(struct rpc_task *); · 96 unmodified lines | |||
| 97 | 97 | ||
| 98 | struct rpc_call_ops { | 98 | struct rpc_call_ops { |
| 99 | void (*rpc_call_prepare)(struct rpc_task *, void *); | 99 | void (*rpc_call_prepare)(struct rpc_task *, void *); |
| 100 | void (*rpc_call_prepare_transmit)(struct rpc_task *, void *); | ||
| 100 | void (*rpc_call_done)(struct rpc_task *, void *); | 101 | void (*rpc_call_done)(struct rpc_task *, void *); |
| 101 | void (*rpc_count_stats)(struct rpc_task *, void *); | 102 | void (*rpc_count_stats)(struct rpc_task *, void *); |
| 102 | void (*rpc_release)(void *); | 103 | void (*rpc_release)(void *); |
| @@ -303,4 +304,12 @@ rpc_clnt_swap_deactivate(struct rpc_clnt *clnt) · 200 unmodified lines | |||
| 303 | } | 304 | } |
| 304 | #endif /* CONFIG_SUNRPC_SWAP */ | 305 | #endif /* CONFIG_SUNRPC_SWAP */ |
| 305 | 306 | ||
| 307 | static inline bool | ||
| 308 | rpc_task_need_resched(const struct rpc_task *task) | ||
| 309 | { | ||
| 310 | if (RPC_IS_QUEUED(task) || task->tk_callback) | ||
| 311 | return true; | ||
| 312 | return false; | ||
| 313 | } | ||
| 314 | |||
| 306 | #endif /* _LINUX_SUNRPC_SCHED_H_ */ | 315 | #endif /* _LINUX_SUNRPC_SCHED_H_ */ |
| @@ -87,6 +87,16 @@ xdr_buf_init(struct xdr_buf *buf, void *start, size_t len) · 86 unmodified lines | |||
| 87 | #define xdr_one cpu_to_be32(1) | 87 | #define xdr_one cpu_to_be32(1) |
| 88 | #define xdr_two cpu_to_be32(2) | 88 | #define xdr_two cpu_to_be32(2) |
| 89 | 89 | ||
| 90 | #define rpc_auth_null cpu_to_be32(RPC_AUTH_NULL) | ||
| 91 | #define rpc_auth_unix cpu_to_be32(RPC_AUTH_UNIX) | ||
| 92 | #define rpc_auth_short cpu_to_be32(RPC_AUTH_SHORT) | ||
| 93 | #define rpc_auth_gss cpu_to_be32(RPC_AUTH_GSS) | ||
| 94 | |||
| 95 | #define rpc_call cpu_to_be32(RPC_CALL) | ||
| 96 | #define rpc_reply cpu_to_be32(RPC_REPLY) | ||
| 97 | |||
| 98 | #define rpc_msg_accepted cpu_to_be32(RPC_MSG_ACCEPTED) | ||
| 99 | |||
| 90 | #define rpc_success cpu_to_be32(RPC_SUCCESS) | 100 | #define rpc_success cpu_to_be32(RPC_SUCCESS) |
| 91 | #define rpc_prog_unavail cpu_to_be32(RPC_PROG_UNAVAIL) | 101 | #define rpc_prog_unavail cpu_to_be32(RPC_PROG_UNAVAIL) |
| 92 | #define rpc_prog_mismatch cpu_to_be32(RPC_PROG_MISMATCH) | 102 | #define rpc_prog_mismatch cpu_to_be32(RPC_PROG_MISMATCH) |
| @@ -95,6 +105,9 @@ xdr_buf_init(struct xdr_buf *buf, void *start, size_t len) · 2 unmodified lines | |||
| 95 | #define rpc_system_err cpu_to_be32(RPC_SYSTEM_ERR) | 105 | #define rpc_system_err cpu_to_be32(RPC_SYSTEM_ERR) |
| 96 | #define rpc_drop_reply cpu_to_be32(RPC_DROP_REPLY) | 106 | #define rpc_drop_reply cpu_to_be32(RPC_DROP_REPLY) |
| 97 | 107 | ||
| 108 | #define rpc_mismatch cpu_to_be32(RPC_MISMATCH) | ||
| 109 | #define rpc_auth_error cpu_to_be32(RPC_AUTH_ERROR) | ||
| 110 | |||
| 98 | #define rpc_auth_ok cpu_to_be32(RPC_AUTH_OK) | 111 | #define rpc_auth_ok cpu_to_be32(RPC_AUTH_OK) |
| 99 | #define rpc_autherr_badcred cpu_to_be32(RPC_AUTH_BADCRED) | 112 | #define rpc_autherr_badcred cpu_to_be32(RPC_AUTH_BADCRED) |
| 100 | #define rpc_autherr_rejectedcred cpu_to_be32(RPC_AUTH_REJECTEDCRED) | 113 | #define rpc_autherr_rejectedcred cpu_to_be32(RPC_AUTH_REJECTEDCRED) |
| @@ -103,7 +116,6 @@ xdr_buf_init(struct xdr_buf *buf, void *start, size_t len) · 2 unmodified lines | |||
| 103 | #define rpc_autherr_tooweak cpu_to_be32(RPC_AUTH_TOOWEAK) | 116 | #define rpc_autherr_tooweak cpu_to_be32(RPC_AUTH_TOOWEAK) |
| 104 | #define rpcsec_gsserr_credproblem cpu_to_be32(RPCSEC_GSS_CREDPROBLEM) | 117 | #define rpcsec_gsserr_credproblem cpu_to_be32(RPCSEC_GSS_CREDPROBLEM) |
| 105 | #define rpcsec_gsserr_ctxproblem cpu_to_be32(RPCSEC_GSS_CTXPROBLEM) | 118 | #define rpcsec_gsserr_ctxproblem cpu_to_be32(RPCSEC_GSS_CTXPROBLEM) |
| 106 | #define rpc_autherr_oldseqnum cpu_to_be32(101) | ||
| 107 | 119 | ||
| 108 | /* | 120 | /* |
| 109 | * Miscellaneous XDR helper functions | 121 | * Miscellaneous XDR helper functions |
| @@ -167,7 +179,6 @@ xdr_adjust_iovec(struct kvec *iov, __be32 *p) · 57 unmodified lines | |||
| 167 | extern void xdr_shift_buf(struct xdr_buf *, size_t); | 179 | extern void xdr_shift_buf(struct xdr_buf *, size_t); |
| 168 | extern void xdr_buf_from_iov(struct kvec *, struct xdr_buf *); | 180 | extern void xdr_buf_from_iov(struct kvec *, struct xdr_buf *); |
| 169 | extern int xdr_buf_subsegment(struct xdr_buf *, struct xdr_buf *, unsigned int, unsigned int); | 181 | extern int xdr_buf_subsegment(struct xdr_buf *, struct xdr_buf *, unsigned int, unsigned int); |
| 170 | extern void xdr_buf_trim(struct xdr_buf *, unsigned int); | ||
| 171 | extern int xdr_buf_read_netobj(struct xdr_buf *, struct xdr_netobj *, unsigned int); | 182 | extern int xdr_buf_read_netobj(struct xdr_buf *, struct xdr_netobj *, unsigned int); |
| 172 | extern int read_bytes_from_xdr_buf(struct xdr_buf *, unsigned int, void *, unsigned int); | 183 | extern int read_bytes_from_xdr_buf(struct xdr_buf *, unsigned int, void *, unsigned int); |
| 173 | extern int write_bytes_to_xdr_buf(struct xdr_buf *, unsigned int, void *, unsigned int); | 184 | extern int write_bytes_to_xdr_buf(struct xdr_buf *, unsigned int, void *, unsigned int); |
| @@ -217,6 +228,8 @@ struct xdr_stream { · 43 unmodified lines | |||
| 217 | struct kvec scratch; /* Scratch buffer */ | 228 | struct kvec scratch; /* Scratch buffer */ |
| 218 | struct page **page_ptr; /* pointer to the current page */ | 229 | struct page **page_ptr; /* pointer to the current page */ |
| 219 | unsigned int nwords; /* Remaining decode buffer length */ | 230 | unsigned int nwords; /* Remaining decode buffer length */ |
| 231 | |||
| 232 | struct rpc_rqst *rqst; /* For debugging */ | ||
| 220 | }; | 233 | }; |
| 221 | 234 | ||
| 222 | /* | 235 | /* |
| @@ -227,7 +240,8 @@ typedef void (*kxdreproc_t)(struct rpc_rqst *rqstp, struct xdr_stream *xdr, · 4 unmodified lines | |||
| 227 | typedef int (*kxdrdproc_t)(struct rpc_rqst *rqstp, struct xdr_stream *xdr, | 240 | typedef int (*kxdrdproc_t)(struct rpc_rqst *rqstp, struct xdr_stream *xdr, |
| 228 | void *obj); | 241 | void *obj); |
| 229 | 242 | ||
| 230 | extern void xdr_init_encode(struct xdr_stream *xdr, struct xdr_buf *buf, __be32 *p); | 243 | extern void xdr_init_encode(struct xdr_stream *xdr, struct xdr_buf *buf, |
| 244 | __be32 *p, struct rpc_rqst *rqst); | ||
| 231 | extern __be32 *xdr_reserve_space(struct xdr_stream *xdr, size_t nbytes); | 245 | extern __be32 *xdr_reserve_space(struct xdr_stream *xdr, size_t nbytes); |
| 232 | extern void xdr_commit_encode(struct xdr_stream *xdr); | 246 | extern void xdr_commit_encode(struct xdr_stream *xdr); |
| 233 | extern void xdr_truncate_encode(struct xdr_stream *xdr, size_t len); | 247 | extern void xdr_truncate_encode(struct xdr_stream *xdr, size_t len); |
| @@ -235,7 +249,8 @@ extern int xdr_restrict_buflen(struct xdr_stream *xdr, int newbuflen); · 1 unmodified line | |||
| 235 | extern void xdr_write_pages(struct xdr_stream *xdr, struct page **pages, | 249 | extern void xdr_write_pages(struct xdr_stream *xdr, struct page **pages, |
| 236 | unsigned int base, unsigned int len); | 250 | unsigned int base, unsigned int len); |
| 237 | extern unsigned int xdr_stream_pos(const struct xdr_stream *xdr); | 251 | extern unsigned int xdr_stream_pos(const struct xdr_stream *xdr); |
| 238 | extern void xdr_init_decode(struct xdr_stream *xdr, struct xdr_buf *buf, __be32 *p); | 252 | extern void xdr_init_decode(struct xdr_stream *xdr, struct xdr_buf *buf, |
| 253 | __be32 *p, struct rpc_rqst *rqst); | ||
| 239 | extern void xdr_init_decode_pages(struct xdr_stream *xdr, struct xdr_buf *buf, | 254 | extern void xdr_init_decode_pages(struct xdr_stream *xdr, struct xdr_buf *buf, |
| 240 | struct page **pages, unsigned int len); | 255 | struct page **pages, unsigned int len); |
| 241 | extern void xdr_set_scratch_buffer(struct xdr_stream *xdr, void *buf, size_t buflen); | 256 | extern void xdr_set_scratch_buffer(struct xdr_stream *xdr, void *buf, size_t buflen); |
| @@ -196,8 +196,6 @@ struct rpc_xprt { · 195 unmodified lines | |||
| 196 | 196 | ||
| 197 | size_t max_payload; /* largest RPC payload size, | 197 | size_t max_payload; /* largest RPC payload size, |
| 198 | in bytes */ | 198 | in bytes */ |
| 199 | unsigned int tsh_size; /* size of transport specific | ||
| 200 | header */ | ||
| 201 | 199 | ||
| 202 | struct rpc_wait_queue binding; /* requests waiting on rpcbind */ | 200 | struct rpc_wait_queue binding; /* requests waiting on rpcbind */ |
| 203 | struct rpc_wait_queue sending; /* requests waiting to send */ | 201 | struct rpc_wait_queue sending; /* requests waiting to send */ |
| @@ -362,11 +360,6 @@ struct rpc_xprt * xprt_alloc(struct net *net, size_t size, · 158 unmodified lines | |||
| 362 | unsigned int max_req); | 360 | unsigned int max_req); |
| 363 | void xprt_free(struct rpc_xprt *); | 361 | void xprt_free(struct rpc_xprt *); |
| 364 | 362 | ||
| 365 | static inline __be32 *xprt_skip_transport_header(struct rpc_xprt *xprt, __be32 *p) | ||
| 366 | { | ||
| 367 | return p + xprt->tsh_size; | ||
| 368 | } | ||
| 369 | |||
| 370 | static inline int | 363 | static inline int |
| 371 | xprt_enable_swap(struct rpc_xprt *xprt) | 364 | xprt_enable_swap(struct rpc_xprt *xprt) |
| 372 | { | 365 | { |
| @@ -26,6 +26,7 @@ struct sock_xprt { · 25 unmodified lines | |||
| 26 | */ | 26 | */ |
| 27 | struct socket * sock; | 27 | struct socket * sock; |
| 28 | struct sock * inet; | 28 | struct sock * inet; |
| 29 | struct file * file; | ||
| 29 | 30 | ||
| 30 | /* | 31 | /* |
| 31 | * State of TCP reply receive | 32 | * State of TCP reply receive |