The purpose of this series is to convert the NFSD XDR encoder and decoder functions to use the struct xdr_stream API. This is largely a refactor/clean-up, but there are some long-term benefits: - More robust input sanitization in the NFSD decoders - Ability to use common kernel library functions with XDR stream APIs: for example GSS-API - Align the code itself with the RFCs so it is easier to learn, understand, and verify our XDR implementation - Removal of as much explicit manipulation of pages as possible to help make the transition to xdr->bvecs smoother With this initial posting, I'm starting with just the NFSv4 decoder face lift to make it easier to review. However, these posted patches and more are available in a topic branch in my git repo: git://git.linux-nfs.org/projects/cel/cel-2.6.git nfsd-xdr_stream --- Chuck Lever (61): NFSD: Fix returned READDIR offset cookie SUNRPC: Add xdr_set_scratch_page() and xdr_reset_scratch_buffer() SUNRPC: Prepare for xdr_stream-style decoding on the server-side NFSD: Add common helpers to decode void args and encode void results NFSD: Replace the internals of the READ_BUF() macro NFSD: Replace READ* macros in nfsd4_decode_access() NFSD: Replace READ* macros in nfsd4_decode_close() NFSD: Replace READ* macros in nfsd4_decode_commit() NFSD: Replace READ* macros in nfsd4_decode_create() NFSD: Replace READ* macros in nfsd4_decode_bitmap() NFSD: Replace READ* macros in nfsd4_decode_link() NFSD: Relocate nfsd4_decode_opaque() NFSD: Replace READ* macros in nfsd4_decode_lock() NFSD: Replace READ* macros in nfsd4_decode_lockt() NFSD: Replace READ* macros in nfsd4_decode_locku() NFSD: Replace READ* macros in nfsd4_decode_lookup() NFSD: Replace READ* macros in nfsd4_decode_time() NFSD: Replace READ* macros in nfsd4_decode_fattr() NFSD: Replace READ* macros in nfsd4_decode_open() NFSD: Replace READ* macros in nfsd4_decode_open_confirm() NFSD: Replace READ* macros in nfsd4_decode_open_downgrade() NFSD: Replace READ* macros in nfsd4_decode_putfh() NFSD: Replace READ* macros in nfsd4_decode_read() NFSD: Replace READ* macros in nfsd4_decode_readdir() NFSD: Replace READ* macros in nfsd4_decode_remove() NFSD: Replace READ* macros in nfsd4_decode_rename() NFSD: Replace READ* macros in nfsd4_decode_renew() NFSD: Replace READ* macros in nfsd4_decode_secinfo() NFSD: Replace READ* macros in nfsd4_decode_setclientid() NFSD: Replace READ* macros in nfsd4_decode_setclientid_confirm() NFSD: Replace READ* macros in nfsd4_decode_verify() NFSD: Replace READ* macros in nfsd4_decode_write() NFSD: Replace READ* macros in nfsd4_decode_release_lockowner() NFSD: Replace READ* macros in nfsd4_decode_cb_sec() NFSD: Replace READ* macros in nfsd4_decode_backchannel_ctl() NFSD: Replace READ* macros in nfsd4_decode_bind_conn_to_session() NFSD: Add a separate decoder to handle state_protect_ops NFSD: Add a separate decoder for ssv_sp_parms NFSD: Add a helper to decode state_protect4_a NFSD: Replace READ* macros in nfsd4_decode_exchange_id() NFSD: Replace READ* macros in nfsd4_decode_create_session() NFSD: Replace READ* macros in nfsd4_decode_destroy_session() NFSD: Replace READ* macros in nfsd4_decode_free_stateid() NFSD: Replace READ* macros in nfsd4_decode_getdeviceinfo() NFSD: Replace READ* macros in nfsd4_decode_layoutcommit() NFSD: Replace READ* macros in nfsd4_decode_layoutget() NFSD: Replace READ* macros in nfsd4_decode_layoutreturn() NFSD: Replace READ* macros in nfsd4_decode_secinfo_no_name() NFSD: Replace READ* macros in nfsd4_decode_sequence() NFSD: Replace READ* macros in nfsd4_decode_test_stateid() NFSD: Replace READ* macros in nfsd4_decode_destroy_clientid() NFSD: Replace READ* macros in nfsd4_decode_reclaim_complete() NFSD: Replace READ* macros in nfsd4_decode_fallocate() NFSD: Replace READ* macros in nfsd4_decode_clone() NFSD: Replace READ* macros in nfsd4_decode_copy() NFSD: Replace READ* macros in nfsd4_decode_seek() NFSD: Replace READ* macros in nfsd4_decode_xattr_name() NFSD: Replace READ* macros in nfsd4_decode_setxattr() NFSD: Replace READ* macros in nfsd4_decode_listxattrs() NFSD: Replace READ* macros in nfsd4_decode_compound() NFSD: Remove macros that are no longer used fs/nfs/blocklayout/blocklayout.c | 2 +- fs/nfs/blocklayout/dev.c | 2 +- fs/nfs/dir.c | 2 +- fs/nfs/filelayout/filelayout.c | 2 +- fs/nfs/filelayout/filelayoutdev.c | 2 +- fs/nfs/flexfilelayout/flexfilelayout.c | 2 +- fs/nfs/flexfilelayout/flexfilelayoutdev.c | 2 +- fs/nfs/nfs42xdr.c | 2 +- fs/nfs/nfs4xdr.c | 6 +- fs/nfsd/nfs2acl.c | 21 +- fs/nfsd/nfs3acl.c | 8 +- fs/nfsd/nfs3proc.c | 10 +- fs/nfsd/nfs3xdr.c | 11 - fs/nfsd/nfs4proc.c | 24 +- fs/nfsd/nfs4state.c | 2 +- fs/nfsd/nfs4xdr.c | 2253 +++++++++++---------- fs/nfsd/nfsd.h | 8 + fs/nfsd/nfsproc.c | 25 +- fs/nfsd/nfssvc.c | 27 +- fs/nfsd/nfsxdr.c | 10 - fs/nfsd/xdr.h | 2 - fs/nfsd/xdr3.h | 2 - fs/nfsd/xdr4.h | 28 +- include/linux/sunrpc/svc.h | 16 + include/linux/sunrpc/xdr.h | 71 +- include/uapi/linux/nfs4.h | 1 + net/sunrpc/auth_gss/gss_rpc_xdr.c | 2 +- net/sunrpc/svc.c | 5 + net/sunrpc/xdr.c | 72 +- 29 files changed, 1451 insertions(+), 1169 deletions(-) -- Chuck Lever