linux/fs/nfsd/nfs4xdr.c

/*
 *  Server-side XDR for NFSv4
 *
 *  Copyright (c) 2002 The Regents of the University of Michigan.
 *  All rights reserved.
 *
 *  Kendrick Smith <[email protected]>
 *  Andy Adamson   <[email protected]>
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions
 *  are met:
 *
 *  1. Redistributions of source code must retain the above copyright
 *     notice, this list of conditions and the following disclaimer.
 *  2. Redistributions in binary form must reproduce the above copyright
 *     notice, this list of conditions and the following disclaimer in the
 *     documentation and/or other materials provided with the distribution.
 *  3. Neither the name of the University nor the names of its
 *     contributors may be used to endorse or promote products derived
 *     from this software without specific prior written permission.
 *
 *  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
 *  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 *  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 *  DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 *  FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 *  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 *  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
 *  BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
 *  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 *  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

#include <linux/file.h>
#include <linux/slab.h>
#include <linux/namei.h>
#include <linux/statfs.h>
#include <linux/utsname.h>
#include <linux/pagemap.h>
#include <linux/sunrpc/svcauth_gss.h>
#include <linux/sunrpc/addr.h>
#include <linux/xattr.h>
#include <linux/vmalloc.h>

#include <uapi/linux/xattr.h>

#include "idmap.h"
#include "acl.h"
#include "xdr4.h"
#include "vfs.h"
#include "state.h"
#include "cache.h"
#include "netns.h"
#include "pnfs.h"
#include "filecache.h"

#include "trace.h"

#ifdef CONFIG_NFSD_V4_SECURITY_LABEL
#include <linux/security.h>
#endif


#define NFSDDBG_FACILITY

const u32 nfsd_suppattrs[3][3] =;

/*
 * As per referral draft, the fsid for a referral MUST be different from the fsid of the containing
 * directory in order to indicate to the client that a filesystem boundary is present
 * We use a fixed fsid for a referral
 */
#define NFS4_REFERRAL_FSID_MAJOR
#define NFS4_REFERRAL_FSID_MINOR

static __be32
check_filename(char *str, int len)
{}

static int zero_clientid(clientid_t *clid)
{}

/**
 * svcxdr_tmpalloc - allocate memory to be freed after compound processing
 * @argp: NFSv4 compound argument structure
 * @len: length of buffer to allocate
 *
 * Allocates a buffer of size @len to be freed when processing the compound
 * operation described in @argp finishes.
 */
static void *
svcxdr_tmpalloc(struct nfsd4_compoundargs *argp, size_t len)
{}

/*
 * For xdr strings that need to be passed to other kernel api's
 * as null-terminated strings.
 *
 * Note null-terminating in place usually isn't safe since the
 * buffer might end on a page boundary.
 */
static char *
svcxdr_dupstr(struct nfsd4_compoundargs *argp, void *buf, size_t len)
{}

static void *
svcxdr_savemem(struct nfsd4_compoundargs *argp, __be32 *p, size_t len)
{}

/*
 * NFSv4 basic data type decoders
 */

/*
 * This helper handles variable-length opaques which belong to protocol
 * elements that this implementation does not support.
 */
static __be32
nfsd4_decode_ignored_string(struct nfsd4_compoundargs *argp, u32 maxlen)
{}

static __be32
nfsd4_decode_opaque(struct nfsd4_compoundargs *argp, struct xdr_netobj *o)
{}

static __be32
nfsd4_decode_component4(struct nfsd4_compoundargs *argp, char **namp, u32 *lenp)
{}

static __be32
nfsd4_decode_nfstime4(struct nfsd4_compoundargs *argp, struct timespec64 *tv)
{}

static __be32
nfsd4_decode_verifier4(struct nfsd4_compoundargs *argp, nfs4_verifier *verf)
{}

/**
 * nfsd4_decode_bitmap4 - Decode an NFSv4 bitmap4
 * @argp: NFSv4 compound argument structure
 * @bmval: pointer to an array of u32's to decode into
 * @bmlen: size of the @bmval array
 *
 * The server needs to return nfs_ok rather than nfserr_bad_xdr when
 * encountering bitmaps containing bits it does not recognize. This
 * includes bits in bitmap words past WORDn, where WORDn is the last
 * bitmap WORD the implementation currently supports. Thus we are
 * careful here to simply ignore bits in bitmap words that this
 * implementation has yet to support explicitly.
 *
 * Return values:
 *   %nfs_ok: @bmval populated successfully
 *   %nfserr_bad_xdr: the encoded bitmap was invalid
 */
static __be32
nfsd4_decode_bitmap4(struct nfsd4_compoundargs *argp, u32 *bmval, u32 bmlen)
{}

static __be32
nfsd4_decode_nfsace4(struct nfsd4_compoundargs *argp, struct nfs4_ace *ace)
{}

/* A counted array of nfsace4's */
static noinline __be32
nfsd4_decode_acl(struct nfsd4_compoundargs *argp, struct nfs4_acl **acl)
{}

static noinline __be32
nfsd4_decode_security_label(struct nfsd4_compoundargs *argp,
			    struct xdr_netobj *label)
{}

static __be32
nfsd4_decode_fattr4(struct nfsd4_compoundargs *argp, u32 *bmval, u32 bmlen,
		    struct iattr *iattr, struct nfs4_acl **acl,
		    struct xdr_netobj *label, int *umask)
{}

static __be32
nfsd4_decode_stateid4(struct nfsd4_compoundargs *argp, stateid_t *sid)
{}

static __be32
nfsd4_decode_clientid4(struct nfsd4_compoundargs *argp, clientid_t *clientid)
{}

static __be32
nfsd4_decode_state_owner4(struct nfsd4_compoundargs *argp,
			  clientid_t *clientid, struct xdr_netobj *owner)
{}

#ifdef CONFIG_NFSD_PNFS
static __be32
nfsd4_decode_deviceid4(struct nfsd4_compoundargs *argp,
		       struct nfsd4_deviceid *devid)
{}

static __be32
nfsd4_decode_layoutupdate4(struct nfsd4_compoundargs *argp,
			   struct nfsd4_layoutcommit *lcp)
{}

static __be32
nfsd4_decode_layoutreturn4(struct nfsd4_compoundargs *argp,
			   struct nfsd4_layoutreturn *lrp)
{}

#endif /* CONFIG_NFSD_PNFS */

static __be32
nfsd4_decode_sessionid4(struct nfsd4_compoundargs *argp,
			struct nfs4_sessionid *sessionid)
{}

/* Defined in Appendix A of RFC 5531 */
static __be32
nfsd4_decode_authsys_parms(struct nfsd4_compoundargs *argp,
			   struct nfsd4_cb_sec *cbs)
{}

static __be32
nfsd4_decode_gss_cb_handles4(struct nfsd4_compoundargs *argp,
			     struct nfsd4_cb_sec *cbs)
{}

/* a counted array of callback_sec_parms4 items */
static __be32
nfsd4_decode_cb_sec(struct nfsd4_compoundargs *argp, struct nfsd4_cb_sec *cbs)
{}


/*
 * NFSv4 operation argument decoders
 */

static __be32
nfsd4_decode_access(struct nfsd4_compoundargs *argp,
		    union nfsd4_op_u *u)
{}

static __be32
nfsd4_decode_close(struct nfsd4_compoundargs *argp, union nfsd4_op_u *u)
{}


static __be32
nfsd4_decode_commit(struct nfsd4_compoundargs *argp, union nfsd4_op_u *u)
{}

static __be32
nfsd4_decode_create(struct nfsd4_compoundargs *argp, union nfsd4_op_u *u)
{}

static inline __be32
nfsd4_decode_delegreturn(struct nfsd4_compoundargs *argp, union nfsd4_op_u *u)
{}

static inline __be32
nfsd4_decode_getattr(struct nfsd4_compoundargs *argp, union nfsd4_op_u *u)
{}

static __be32
nfsd4_decode_link(struct nfsd4_compoundargs *argp, union nfsd4_op_u *u)
{}

static __be32
nfsd4_decode_open_to_lock_owner4(struct nfsd4_compoundargs *argp,
				 struct nfsd4_lock *lock)
{}

static __be32
nfsd4_decode_exist_lock_owner4(struct nfsd4_compoundargs *argp,
			       struct nfsd4_lock *lock)
{}

static __be32
nfsd4_decode_locker4(struct nfsd4_compoundargs *argp, struct nfsd4_lock *lock)
{}

static __be32
nfsd4_decode_lock(struct nfsd4_compoundargs *argp, union nfsd4_op_u *u)
{}

static __be32
nfsd4_decode_lockt(struct nfsd4_compoundargs *argp, union nfsd4_op_u *u)
{}

static __be32
nfsd4_decode_locku(struct nfsd4_compoundargs *argp, union nfsd4_op_u *u)
{}

static __be32
nfsd4_decode_lookup(struct nfsd4_compoundargs *argp, union nfsd4_op_u *u)
{}

static __be32
nfsd4_decode_createhow4(struct nfsd4_compoundargs *argp, struct nfsd4_open *open)
{}

static __be32
nfsd4_decode_openflag4(struct nfsd4_compoundargs *argp, struct nfsd4_open *open)
{}

static __be32 nfsd4_decode_share_access(struct nfsd4_compoundargs *argp, u32 *share_access, u32 *deleg_want, u32 *deleg_when)
{}

static __be32 nfsd4_decode_share_deny(struct nfsd4_compoundargs *argp, u32 *x)
{}

static __be32
nfsd4_decode_open_claim4(struct nfsd4_compoundargs *argp,
			 struct nfsd4_open *open)
{}

static __be32
nfsd4_decode_open(struct nfsd4_compoundargs *argp, union nfsd4_op_u *u)
{}

static __be32
nfsd4_decode_open_confirm(struct nfsd4_compoundargs *argp,
			  union nfsd4_op_u *u)
{}

static __be32
nfsd4_decode_open_downgrade(struct nfsd4_compoundargs *argp,
			    union nfsd4_op_u *u)
{}

static __be32
nfsd4_decode_putfh(struct nfsd4_compoundargs *argp, union nfsd4_op_u *u)
{}

static __be32
nfsd4_decode_putpubfh(struct nfsd4_compoundargs *argp, union nfsd4_op_u *p)
{}

static __be32
nfsd4_decode_read(struct nfsd4_compoundargs *argp, union nfsd4_op_u *u)
{}

static __be32
nfsd4_decode_readdir(struct nfsd4_compoundargs *argp, union nfsd4_op_u *u)
{}

static __be32
nfsd4_decode_remove(struct nfsd4_compoundargs *argp, union nfsd4_op_u *u)
{}

static __be32
nfsd4_decode_rename(struct nfsd4_compoundargs *argp, union nfsd4_op_u *u)
{}

static __be32
nfsd4_decode_renew(struct nfsd4_compoundargs *argp, union nfsd4_op_u *u)
{}

static __be32
nfsd4_decode_secinfo(struct nfsd4_compoundargs *argp,
		     union nfsd4_op_u *u)
{}

static __be32
nfsd4_decode_setattr(struct nfsd4_compoundargs *argp, union nfsd4_op_u *u)
{}

static __be32
nfsd4_decode_setclientid(struct nfsd4_compoundargs *argp, union nfsd4_op_u *u)
{}

static __be32
nfsd4_decode_setclientid_confirm(struct nfsd4_compoundargs *argp,
				 union nfsd4_op_u *u)
{}

/* Also used for NVERIFY */
static __be32
nfsd4_decode_verify(struct nfsd4_compoundargs *argp, union nfsd4_op_u *u)
{}

static __be32
nfsd4_decode_write(struct nfsd4_compoundargs *argp, union nfsd4_op_u *u)
{}

static __be32
nfsd4_decode_release_lockowner(struct nfsd4_compoundargs *argp,
			       union nfsd4_op_u *u)
{}

static __be32 nfsd4_decode_backchannel_ctl(struct nfsd4_compoundargs *argp,
					   union nfsd4_op_u *u)
{}

static __be32 nfsd4_decode_bind_conn_to_session(struct nfsd4_compoundargs *argp,
						union nfsd4_op_u *u)
{}

static __be32
nfsd4_decode_state_protect_ops(struct nfsd4_compoundargs *argp,
			       struct nfsd4_exchange_id *exid)
{}

/*
 * This implementation currently does not support SP4_SSV.
 * This decoder simply skips over these arguments.
 */
static noinline __be32
nfsd4_decode_ssv_sp_parms(struct nfsd4_compoundargs *argp,
			  struct nfsd4_exchange_id *exid)
{}

static __be32
nfsd4_decode_state_protect4_a(struct nfsd4_compoundargs *argp,
			      struct nfsd4_exchange_id *exid)
{}

static __be32
nfsd4_decode_nfs_impl_id4(struct nfsd4_compoundargs *argp,
			  struct nfsd4_exchange_id *exid)
{}

static __be32
nfsd4_decode_exchange_id(struct nfsd4_compoundargs *argp,
			 union nfsd4_op_u *u)
{}

static __be32
nfsd4_decode_channel_attrs4(struct nfsd4_compoundargs *argp,
			    struct nfsd4_channel_attrs *ca)
{}

static __be32
nfsd4_decode_create_session(struct nfsd4_compoundargs *argp,
			    union nfsd4_op_u *u)
{}

static __be32
nfsd4_decode_destroy_session(struct nfsd4_compoundargs *argp,
			     union nfsd4_op_u *u)
{}

static __be32
nfsd4_decode_free_stateid(struct nfsd4_compoundargs *argp,
			  union nfsd4_op_u *u)
{}

static __be32
nfsd4_decode_get_dir_delegation(struct nfsd4_compoundargs *argp,
		union nfsd4_op_u *u)
{}

#ifdef CONFIG_NFSD_PNFS
static __be32
nfsd4_decode_getdeviceinfo(struct nfsd4_compoundargs *argp,
		union nfsd4_op_u *u)
{}

static __be32
nfsd4_decode_layoutcommit(struct nfsd4_compoundargs *argp,
			  union nfsd4_op_u *u)
{}

static __be32
nfsd4_decode_layoutget(struct nfsd4_compoundargs *argp,
		union nfsd4_op_u *u)
{}

static __be32
nfsd4_decode_layoutreturn(struct nfsd4_compoundargs *argp,
		union nfsd4_op_u *u)
{}
#endif /* CONFIG_NFSD_PNFS */

static __be32 nfsd4_decode_secinfo_no_name(struct nfsd4_compoundargs *argp,
					   union nfsd4_op_u *u)
{}

static __be32
nfsd4_decode_sequence(struct nfsd4_compoundargs *argp,
		      union nfsd4_op_u *u)
{}

static __be32
nfsd4_decode_test_stateid(struct nfsd4_compoundargs *argp,
			  union nfsd4_op_u *u)
{}

static __be32 nfsd4_decode_destroy_clientid(struct nfsd4_compoundargs *argp,
					    union nfsd4_op_u *u)
{}

static __be32 nfsd4_decode_reclaim_complete(struct nfsd4_compoundargs *argp,
					    union nfsd4_op_u *u)
{}

static __be32
nfsd4_decode_fallocate(struct nfsd4_compoundargs *argp,
		       union nfsd4_op_u *u)
{}

static __be32 nfsd4_decode_nl4_server(struct nfsd4_compoundargs *argp,
				      struct nl4_server *ns)
{}

static __be32
nfsd4_decode_copy(struct nfsd4_compoundargs *argp, union nfsd4_op_u *u)
{}

static __be32
nfsd4_decode_copy_notify(struct nfsd4_compoundargs *argp,
			 union nfsd4_op_u *u)
{}

static __be32
nfsd4_decode_offload_status(struct nfsd4_compoundargs *argp,
			    union nfsd4_op_u *u)
{}

static __be32
nfsd4_decode_seek(struct nfsd4_compoundargs *argp, union nfsd4_op_u *u)
{}

static __be32
nfsd4_decode_clone(struct nfsd4_compoundargs *argp, union nfsd4_op_u *u)
{}

/*
 * XDR data that is more than PAGE_SIZE in size is normally part of a
 * read or write. However, the size of extended attributes is limited
 * by the maximum request size, and then further limited by the underlying
 * filesystem limits. This can exceed PAGE_SIZE (currently, XATTR_SIZE_MAX
 * is 64k). Since there is no kvec- or page-based interface to xattrs,
 * and we're not dealing with contiguous pages, we need to do some copying.
 */

/*
 * Decode data into buffer.
 */
static __be32
nfsd4_vbuf_from_vector(struct nfsd4_compoundargs *argp, struct xdr_buf *xdr,
		       char **bufp, size_t buflen)
{}

/*
 * Get a user extended attribute name from the XDR buffer.
 * It will not have the "user." prefix, so prepend it.
 * Lastly, check for nul characters in the name.
 */
static __be32
nfsd4_decode_xattr_name(struct nfsd4_compoundargs *argp, char **namep)
{}

/*
 * A GETXATTR op request comes without a length specifier. We just set the
 * maximum length for the reply based on XATTR_SIZE_MAX and the maximum
 * channel reply size. nfsd_getxattr will probe the length of the xattr,
 * check it against getxa_len, and allocate + return the value.
 */
static __be32
nfsd4_decode_getxattr(struct nfsd4_compoundargs *argp,
		      union nfsd4_op_u *u)
{}

static __be32
nfsd4_decode_setxattr(struct nfsd4_compoundargs *argp,
		      union nfsd4_op_u *u)
{}

static __be32
nfsd4_decode_listxattrs(struct nfsd4_compoundargs *argp,
			union nfsd4_op_u *u)
{}

static __be32
nfsd4_decode_removexattr(struct nfsd4_compoundargs *argp,
			 union nfsd4_op_u *u)
{}

static __be32
nfsd4_decode_noop(struct nfsd4_compoundargs *argp, union nfsd4_op_u *p)
{}

static __be32
nfsd4_decode_notsupp(struct nfsd4_compoundargs *argp, union nfsd4_op_u *p)
{}

nfsd4_dec;

static const nfsd4_dec nfsd4_dec_ops[] =;

static inline bool
nfsd4_opnum_in_range(struct nfsd4_compoundargs *argp, struct nfsd4_op *op)
{}

static bool
nfsd4_decode_compound(struct nfsd4_compoundargs *argp)
{}

static __be32 nfsd4_encode_nfs_fh4(struct xdr_stream *xdr,
				   struct knfsd_fh *fh_handle)
{}

/* This is a frequently-encoded type; open-coded for speed */
static __be32 nfsd4_encode_nfstime4(struct xdr_stream *xdr,
				    const struct timespec64 *tv)
{}

static __be32 nfsd4_encode_specdata4(struct xdr_stream *xdr,
				     unsigned int major, unsigned int minor)
{}

static __be32
nfsd4_encode_change_info4(struct xdr_stream *xdr, const struct nfsd4_change_info *c)
{}

static __be32 nfsd4_encode_netaddr4(struct xdr_stream *xdr,
				    const struct nfs42_netaddr *addr)
{}

/* Encode as an array of strings the string given with components
 * separated @sep, escaped with esc_enter and esc_exit.
 */
static __be32 nfsd4_encode_components_esc(struct xdr_stream *xdr, char sep,
					  char *components, char esc_enter,
					  char esc_exit)
{}

/* Encode as an array of strings the string given with components
 * separated @sep.
 */
static __be32 nfsd4_encode_components(struct xdr_stream *xdr, char sep,
				      char *components)
{}

static __be32 nfsd4_encode_fs_location4(struct xdr_stream *xdr,
					struct nfsd4_fs_location *location)
{}

static __be32 nfsd4_encode_pathname4(struct xdr_stream *xdr,
				     const struct path *root,
				     const struct path *path)
{}

static __be32 nfsd4_encode_fs_locations4(struct xdr_stream *xdr,
					 struct svc_rqst *rqstp,
					 struct svc_export *exp)
{}

static __be32 nfsd4_encode_nfsace4(struct xdr_stream *xdr, struct svc_rqst *rqstp,
				   struct nfs4_ace *ace)
{}

#define WORD0_ABSENT_FS_ATTRS
#define WORD1_ABSENT_FS_ATTRS
#define WORD2_ABSENT_FS_ATTRS

#ifdef CONFIG_NFSD_V4_SECURITY_LABEL
static inline __be32
nfsd4_encode_security_label(struct xdr_stream *xdr, struct svc_rqst *rqstp,
			    void *context, int len)
{}
#else
static inline __be32
nfsd4_encode_security_label(struct xdr_stream *xdr, struct svc_rqst *rqstp,
			    void *context, int len)
{ return 0; }
#endif

static __be32 fattr_handle_absent_fs(u32 *bmval0, u32 *bmval1, u32 *bmval2, u32 *rdattr_err)
{}


static int nfsd4_get_mounted_on_ino(struct svc_export *exp, u64 *pino)
{}

static __be32
nfsd4_encode_bitmap4(struct xdr_stream *xdr, u32 bmval0, u32 bmval1, u32 bmval2)
{}

struct nfsd4_fattr_args {};

nfsd4_enc_attr;

static __be32 nfsd4_encode_fattr4__noop(struct xdr_stream *xdr,
					const struct nfsd4_fattr_args *args)
{}

static __be32 nfsd4_encode_fattr4__true(struct xdr_stream *xdr,
					const struct nfsd4_fattr_args *args)
{}

static __be32 nfsd4_encode_fattr4__false(struct xdr_stream *xdr,
					 const struct nfsd4_fattr_args *args)
{}

static __be32 nfsd4_encode_fattr4_supported_attrs(struct xdr_stream *xdr,
						  const struct nfsd4_fattr_args *args)
{}

static __be32 nfsd4_encode_fattr4_type(struct xdr_stream *xdr,
				       const struct nfsd4_fattr_args *args)
{}

static __be32 nfsd4_encode_fattr4_fh_expire_type(struct xdr_stream *xdr,
						 const struct nfsd4_fattr_args *args)
{}

static __be32 nfsd4_encode_fattr4_change(struct xdr_stream *xdr,
					 const struct nfsd4_fattr_args *args)
{}

static __be32 nfsd4_encode_fattr4_size(struct xdr_stream *xdr,
				       const struct nfsd4_fattr_args *args)
{}

static __be32 nfsd4_encode_fattr4_fsid(struct xdr_stream *xdr,
				       const struct nfsd4_fattr_args *args)
{}

static __be32 nfsd4_encode_fattr4_lease_time(struct xdr_stream *xdr,
					     const struct nfsd4_fattr_args *args)
{}

static __be32 nfsd4_encode_fattr4_rdattr_error(struct xdr_stream *xdr,
					       const struct nfsd4_fattr_args *args)
{}

static __be32 nfsd4_encode_fattr4_aclsupport(struct xdr_stream *xdr,
					     const struct nfsd4_fattr_args *args)
{}

static __be32 nfsd4_encode_fattr4_acl(struct xdr_stream *xdr,
				      const struct nfsd4_fattr_args *args)
{}

static __be32 nfsd4_encode_fattr4_filehandle(struct xdr_stream *xdr,
					     const struct nfsd4_fattr_args *args)
{}

static __be32 nfsd4_encode_fattr4_fileid(struct xdr_stream *xdr,
					 const struct nfsd4_fattr_args *args)
{}

static __be32 nfsd4_encode_fattr4_files_avail(struct xdr_stream *xdr,
					      const struct nfsd4_fattr_args *args)
{}

static __be32 nfsd4_encode_fattr4_files_free(struct xdr_stream *xdr,
					     const struct nfsd4_fattr_args *args)
{}

static __be32 nfsd4_encode_fattr4_files_total(struct xdr_stream *xdr,
					      const struct nfsd4_fattr_args *args)
{}

static __be32 nfsd4_encode_fattr4_fs_locations(struct xdr_stream *xdr,
					       const struct nfsd4_fattr_args *args)
{}

static __be32 nfsd4_encode_fattr4_maxfilesize(struct xdr_stream *xdr,
					      const struct nfsd4_fattr_args *args)
{}

static __be32 nfsd4_encode_fattr4_maxlink(struct xdr_stream *xdr,
					  const struct nfsd4_fattr_args *args)
{}

static __be32 nfsd4_encode_fattr4_maxname(struct xdr_stream *xdr,
					  const struct nfsd4_fattr_args *args)
{}

static __be32 nfsd4_encode_fattr4_maxread(struct xdr_stream *xdr,
					  const struct nfsd4_fattr_args *args)
{}

static __be32 nfsd4_encode_fattr4_maxwrite(struct xdr_stream *xdr,
					   const struct nfsd4_fattr_args *args)
{}

static __be32 nfsd4_encode_fattr4_mode(struct xdr_stream *xdr,
				       const struct nfsd4_fattr_args *args)
{}

static __be32 nfsd4_encode_fattr4_numlinks(struct xdr_stream *xdr,
					   const struct nfsd4_fattr_args *args)
{}

static __be32 nfsd4_encode_fattr4_owner(struct xdr_stream *xdr,
					const struct nfsd4_fattr_args *args)
{}

static __be32 nfsd4_encode_fattr4_owner_group(struct xdr_stream *xdr,
					      const struct nfsd4_fattr_args *args)
{}

static __be32 nfsd4_encode_fattr4_rawdev(struct xdr_stream *xdr,
					 const struct nfsd4_fattr_args *args)
{}

static __be32 nfsd4_encode_fattr4_space_avail(struct xdr_stream *xdr,
					      const struct nfsd4_fattr_args *args)
{}

static __be32 nfsd4_encode_fattr4_space_free(struct xdr_stream *xdr,
					     const struct nfsd4_fattr_args *args)
{}

static __be32 nfsd4_encode_fattr4_space_total(struct xdr_stream *xdr,
					      const struct nfsd4_fattr_args *args)
{}

static __be32 nfsd4_encode_fattr4_space_used(struct xdr_stream *xdr,
					     const struct nfsd4_fattr_args *args)
{}

static __be32 nfsd4_encode_fattr4_time_access(struct xdr_stream *xdr,
					      const struct nfsd4_fattr_args *args)
{}

static __be32 nfsd4_encode_fattr4_time_create(struct xdr_stream *xdr,
					      const struct nfsd4_fattr_args *args)
{}

/*
 * ctime (in NFSv4, time_metadata) is not writeable, and the client
 * doesn't really care what resolution could theoretically be stored by
 * the filesystem.
 *
 * The client cares how close together changes can be while still
 * guaranteeing ctime changes.  For most filesystems (which have
 * timestamps with nanosecond fields) that is limited by the resolution
 * of the time returned from current_time() (which I'm assuming to be
 * 1/HZ).
 */
static __be32 nfsd4_encode_fattr4_time_delta(struct xdr_stream *xdr,
					     const struct nfsd4_fattr_args *args)
{}

static __be32 nfsd4_encode_fattr4_time_metadata(struct xdr_stream *xdr,
						const struct nfsd4_fattr_args *args)
{}

static __be32 nfsd4_encode_fattr4_time_modify(struct xdr_stream *xdr,
					      const struct nfsd4_fattr_args *args)
{}

static __be32 nfsd4_encode_fattr4_mounted_on_fileid(struct xdr_stream *xdr,
						    const struct nfsd4_fattr_args *args)
{}

#ifdef CONFIG_NFSD_PNFS

static __be32 nfsd4_encode_fattr4_fs_layout_types(struct xdr_stream *xdr,
						  const struct nfsd4_fattr_args *args)
{}

static __be32 nfsd4_encode_fattr4_layout_types(struct xdr_stream *xdr,
					       const struct nfsd4_fattr_args *args)
{}

static __be32 nfsd4_encode_fattr4_layout_blksize(struct xdr_stream *xdr,
						 const struct nfsd4_fattr_args *args)
{}

#endif

static __be32 nfsd4_encode_fattr4_suppattr_exclcreat(struct xdr_stream *xdr,
						     const struct nfsd4_fattr_args *args)
{}

#ifdef CONFIG_NFSD_V4_SECURITY_LABEL
static __be32 nfsd4_encode_fattr4_sec_label(struct xdr_stream *xdr,
					    const struct nfsd4_fattr_args *args)
{}
#endif

static __be32 nfsd4_encode_fattr4_xattr_support(struct xdr_stream *xdr,
						const struct nfsd4_fattr_args *args)
{}

static const nfsd4_enc_attr nfsd4_enc_fattr4_encode_ops[] =;

/*
 * Note: @fhp can be NULL; in this case, we might have to compose the filehandle
 * ourselves.
 */
static __be32
nfsd4_encode_fattr4(struct svc_rqst *rqstp, struct xdr_stream *xdr,
		    struct svc_fh *fhp, struct svc_export *exp,
		    struct dentry *dentry, const u32 *bmval,
		    int ignore_crossmnt)
{}

static void svcxdr_init_encode_from_buffer(struct xdr_stream *xdr,
				struct xdr_buf *buf, __be32 *p, int bytes)
{}

__be32 nfsd4_encode_fattr_to_buf(__be32 **p, int words,
			struct svc_fh *fhp, struct svc_export *exp,
			struct dentry *dentry, u32 *bmval,
			struct svc_rqst *rqstp, int ignore_crossmnt)
{}

/*
 * The buffer space for this field was reserved during a previous
 * call to nfsd4_encode_entry4().
 */
static void nfsd4_encode_entry4_nfs_cookie4(const struct nfsd4_readdir *readdir,
					    u64 offset)
{}

static inline int attributes_need_mount(u32 *bmval)
{}

static __be32
nfsd4_encode_entry4_fattr(struct nfsd4_readdir *cd, const char *name,
			  int namlen)
{}

static __be32
nfsd4_encode_entry4_rdattr_error(struct xdr_stream *xdr, __be32 nfserr)
{}

static int
nfsd4_encode_entry4(void *ccdv, const char *name, int namlen,
		    loff_t offset, u64 ino, unsigned int d_type)
{}

static __be32
nfsd4_encode_verifier4(struct xdr_stream *xdr, const nfs4_verifier *verf)
{}

static __be32
nfsd4_encode_clientid4(struct xdr_stream *xdr, const clientid_t *clientid)
{}

/* This is a frequently-encoded item; open-coded for speed */
static __be32
nfsd4_encode_stateid4(struct xdr_stream *xdr, const stateid_t *sid)
{}

static __be32
nfsd4_encode_sessionid4(struct xdr_stream *xdr,
			const struct nfs4_sessionid *sessionid)
{}

static __be32
nfsd4_encode_access(struct nfsd4_compoundres *resp, __be32 nfserr,
		    union nfsd4_op_u *u)
{}

static __be32 nfsd4_encode_bind_conn_to_session(struct nfsd4_compoundres *resp, __be32 nfserr,
						union nfsd4_op_u *u)
{}

static __be32
nfsd4_encode_close(struct nfsd4_compoundres *resp, __be32 nfserr,
		   union nfsd4_op_u *u)
{}


static __be32
nfsd4_encode_commit(struct nfsd4_compoundres *resp, __be32 nfserr,
		    union nfsd4_op_u *u)
{}

static __be32
nfsd4_encode_create(struct nfsd4_compoundres *resp, __be32 nfserr,
		    union nfsd4_op_u *u)
{}

static __be32
nfsd4_encode_getattr(struct nfsd4_compoundres *resp, __be32 nfserr,
		     union nfsd4_op_u *u)
{}

static __be32
nfsd4_encode_getfh(struct nfsd4_compoundres *resp, __be32 nfserr,
		   union nfsd4_op_u *u)
{}

static __be32
nfsd4_encode_lock_owner4(struct xdr_stream *xdr, const clientid_t *clientid,
			 const struct xdr_netobj *owner)
{}

static __be32
nfsd4_encode_lock4denied(struct xdr_stream *xdr,
			 const struct nfsd4_lock_denied *ld)
{}

static __be32
nfsd4_encode_lock(struct nfsd4_compoundres *resp, __be32 nfserr,
		  union nfsd4_op_u *u)
{}

static __be32
nfsd4_encode_lockt(struct nfsd4_compoundres *resp, __be32 nfserr,
		   union nfsd4_op_u *u)
{}

static __be32
nfsd4_encode_locku(struct nfsd4_compoundres *resp, __be32 nfserr,
		   union nfsd4_op_u *u)
{}


static __be32
nfsd4_encode_link(struct nfsd4_compoundres *resp, __be32 nfserr,
		  union nfsd4_op_u *u)
{}

/*
 * This implementation does not yet support returning an ACE in an
 * OPEN that offers a delegation.
 */
static __be32
nfsd4_encode_open_nfsace4(struct xdr_stream *xdr)
{}

static __be32
nfsd4_encode_open_read_delegation4(struct xdr_stream *xdr, struct nfsd4_open *open)
{}

static __be32
nfsd4_encode_nfs_space_limit4(struct xdr_stream *xdr, u64 filesize)
{}

static __be32
nfsd4_encode_open_write_delegation4(struct xdr_stream *xdr,
				    struct nfsd4_open *open)
{}

static __be32
nfsd4_encode_open_none_delegation4(struct xdr_stream *xdr,
				   struct nfsd4_open *open)
{}

static __be32
nfsd4_encode_open_delegation4(struct xdr_stream *xdr, struct nfsd4_open *open)
{}

static __be32
nfsd4_encode_open(struct nfsd4_compoundres *resp, __be32 nfserr,
		  union nfsd4_op_u *u)
{}

static __be32
nfsd4_encode_open_confirm(struct nfsd4_compoundres *resp, __be32 nfserr,
			  union nfsd4_op_u *u)
{}

static __be32
nfsd4_encode_open_downgrade(struct nfsd4_compoundres *resp, __be32 nfserr,
			    union nfsd4_op_u *u)
{}

/*
 * The operation of this function assumes that this is the only
 * READ operation in the COMPOUND. If there are multiple READs,
 * we use nfsd4_encode_readv().
 */
static __be32 nfsd4_encode_splice_read(
				struct nfsd4_compoundres *resp,
				struct nfsd4_read *read,
				struct file *file, unsigned long maxcount)
{}

static __be32 nfsd4_encode_readv(struct nfsd4_compoundres *resp,
				 struct nfsd4_read *read,
				 struct file *file, unsigned long maxcount)
{}

static __be32
nfsd4_encode_read(struct nfsd4_compoundres *resp, __be32 nfserr,
		  union nfsd4_op_u *u)
{}

static __be32
nfsd4_encode_readlink(struct nfsd4_compoundres *resp, __be32 nfserr,
		      union nfsd4_op_u *u)
{}

static __be32 nfsd4_encode_dirlist4(struct xdr_stream *xdr,
				    struct nfsd4_readdir *readdir,
				    u32 max_payload)
{}

static __be32
nfsd4_encode_readdir(struct nfsd4_compoundres *resp, __be32 nfserr,
		     union nfsd4_op_u *u)
{}

static __be32
nfsd4_encode_remove(struct nfsd4_compoundres *resp, __be32 nfserr,
		    union nfsd4_op_u *u)
{}

static __be32
nfsd4_encode_rename(struct nfsd4_compoundres *resp, __be32 nfserr,
		    union nfsd4_op_u *u)
{}

static __be32
nfsd4_encode_rpcsec_gss_info(struct xdr_stream *xdr,
			     struct rpcsec_gss_info *info)
{}

static __be32
nfsd4_do_encode_secinfo(struct xdr_stream *xdr, struct svc_export *exp)
{}

static __be32
nfsd4_encode_secinfo(struct nfsd4_compoundres *resp, __be32 nfserr,
		     union nfsd4_op_u *u)
{}

static __be32
nfsd4_encode_secinfo_no_name(struct nfsd4_compoundres *resp, __be32 nfserr,
		     union nfsd4_op_u *u)
{}

static __be32
nfsd4_encode_setattr(struct nfsd4_compoundres *resp, __be32 nfserr,
		     union nfsd4_op_u *u)
{}

static __be32
nfsd4_encode_setclientid(struct nfsd4_compoundres *resp, __be32 nfserr,
			 union nfsd4_op_u *u)
{}

static __be32
nfsd4_encode_write(struct nfsd4_compoundres *resp, __be32 nfserr,
		   union nfsd4_op_u *u)
{}

static __be32
nfsd4_encode_state_protect_ops4(struct xdr_stream *xdr,
				struct nfsd4_exchange_id *exid)
{}

static __be32
nfsd4_encode_state_protect4_r(struct xdr_stream *xdr, struct nfsd4_exchange_id *exid)
{}

static __be32
nfsd4_encode_server_owner4(struct xdr_stream *xdr, struct svc_rqst *rqstp)
{}

static __be32
nfsd4_encode_exchange_id(struct nfsd4_compoundres *resp, __be32 nfserr,
			 union nfsd4_op_u *u)
{}

static __be32
nfsd4_encode_channel_attrs4(struct xdr_stream *xdr,
			    const struct nfsd4_channel_attrs *attrs)
{}

static __be32
nfsd4_encode_create_session(struct nfsd4_compoundres *resp, __be32 nfserr,
			    union nfsd4_op_u *u)
{}

static __be32
nfsd4_encode_sequence(struct nfsd4_compoundres *resp, __be32 nfserr,
		      union nfsd4_op_u *u)
{}

static __be32
nfsd4_encode_test_stateid(struct nfsd4_compoundres *resp, __be32 nfserr,
			  union nfsd4_op_u *u)
{}

static __be32
nfsd4_encode_get_dir_delegation(struct nfsd4_compoundres *resp, __be32 nfserr,
				union nfsd4_op_u *u)
{}

#ifdef CONFIG_NFSD_PNFS
static __be32
nfsd4_encode_device_addr4(struct xdr_stream *xdr,
			  const struct nfsd4_getdeviceinfo *gdev)
{}

static __be32
nfsd4_encode_getdeviceinfo(struct nfsd4_compoundres *resp, __be32 nfserr,
		union nfsd4_op_u *u)
{}

static __be32
nfsd4_encode_layout4(struct xdr_stream *xdr, const struct nfsd4_layoutget *lgp)
{}

static __be32
nfsd4_encode_layoutget(struct nfsd4_compoundres *resp, __be32 nfserr,
		union nfsd4_op_u *u)
{}

static __be32
nfsd4_encode_layoutcommit(struct nfsd4_compoundres *resp, __be32 nfserr,
			  union nfsd4_op_u *u)
{}

static __be32
nfsd4_encode_layoutreturn(struct nfsd4_compoundres *resp, __be32 nfserr,
		union nfsd4_op_u *u)
{}
#endif /* CONFIG_NFSD_PNFS */

static __be32
nfsd4_encode_write_response4(struct xdr_stream *xdr,
			     const struct nfsd4_copy *copy)
{}

static __be32 nfsd4_encode_copy_requirements4(struct xdr_stream *xdr,
					      const struct nfsd4_copy *copy)
{}

static __be32
nfsd4_encode_copy(struct nfsd4_compoundres *resp, __be32 nfserr,
		  union nfsd4_op_u *u)
{}

static __be32
nfsd4_encode_netloc4(struct xdr_stream *xdr, const struct nl4_server *ns)
{}

static __be32
nfsd4_encode_copy_notify(struct nfsd4_compoundres *resp, __be32 nfserr,
			 union nfsd4_op_u *u)
{}

static __be32
nfsd4_encode_offload_status(struct nfsd4_compoundres *resp, __be32 nfserr,
			    union nfsd4_op_u *u)
{}

static __be32
nfsd4_encode_read_plus_data(struct nfsd4_compoundres *resp,
			    struct nfsd4_read *read)
{}

static __be32
nfsd4_encode_read_plus(struct nfsd4_compoundres *resp, __be32 nfserr,
		       union nfsd4_op_u *u)
{}

static __be32
nfsd4_encode_seek(struct nfsd4_compoundres *resp, __be32 nfserr,
		  union nfsd4_op_u *u)
{}

static __be32
nfsd4_encode_noop(struct nfsd4_compoundres *resp, __be32 nfserr,
		  union nfsd4_op_u *p)
{}

/*
 * Encode kmalloc-ed buffer in to XDR stream.
 */
static __be32
nfsd4_vbuf_to_stream(struct xdr_stream *xdr, char *buf, u32 buflen)
{}

static __be32
nfsd4_encode_getxattr(struct nfsd4_compoundres *resp, __be32 nfserr,
		      union nfsd4_op_u *u)
{}

static __be32
nfsd4_encode_setxattr(struct nfsd4_compoundres *resp, __be32 nfserr,
		      union nfsd4_op_u *u)
{}

/*
 * See if there are cookie values that can be rejected outright.
 */
static __be32
nfsd4_listxattr_validate_cookie(struct nfsd4_listxattrs *listxattrs,
				u32 *offsetp)
{}

static __be32
nfsd4_encode_listxattrs(struct nfsd4_compoundres *resp, __be32 nfserr,
			union nfsd4_op_u *u)
{}

static __be32
nfsd4_encode_removexattr(struct nfsd4_compoundres *resp, __be32 nfserr,
			 union nfsd4_op_u *u)
{}

nfsd4_enc;

/*
 * Note: nfsd4_enc_ops vector is shared for v4.0 and v4.1
 * since we don't need to filter out obsolete ops as this is
 * done in the decoding phase.
 */
static const nfsd4_enc nfsd4_enc_ops[] =;

/*
 * Calculate whether we still have space to encode repsize bytes.
 * There are two considerations:
 *     - For NFS versions >=4.1, the size of the reply must stay within
 *       session limits
 *     - For all NFS versions, we must stay within limited preallocated
 *       buffer space.
 *
 * This is called before the operation is processed, so can only provide
 * an upper estimate.  For some nonidempotent operations (such as
 * getattr), it's not necessarily a problem if that estimate is wrong,
 * as we can fail it after processing without significant side effects.
 */
__be32 nfsd4_check_resp_size(struct nfsd4_compoundres *resp, u32 respsize)
{}

void
nfsd4_encode_operation(struct nfsd4_compoundres *resp, struct nfsd4_op *op)
{}

/**
 * nfsd4_encode_replay - encode a result stored in the stateowner reply cache
 * @xdr: send buffer's XDR stream
 * @op: operation being replayed
 *
 * @op->replay->rp_buf contains the previously-sent already-encoded result.
 */
void nfsd4_encode_replay(struct xdr_stream *xdr, struct nfsd4_op *op)
{}

void nfsd4_release_compoundargs(struct svc_rqst *rqstp)
{}

bool
nfs4svc_decode_compoundargs(struct svc_rqst *rqstp, struct xdr_stream *xdr)
{}

bool
nfs4svc_encode_compoundres(struct svc_rqst *rqstp, struct xdr_stream *xdr)
{}