linux/fs/nfs/nfs4proc.c

/*
 *  fs/nfs/nfs4proc.c
 *
 *  Client-side procedure declarations 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/mm.h>
#include <linux/delay.h>
#include <linux/errno.h>
#include <linux/string.h>
#include <linux/ratelimit.h>
#include <linux/printk.h>
#include <linux/slab.h>
#include <linux/sunrpc/clnt.h>
#include <linux/nfs.h>
#include <linux/nfs4.h>
#include <linux/nfs_fs.h>
#include <linux/nfs_page.h>
#include <linux/nfs_mount.h>
#include <linux/namei.h>
#include <linux/mount.h>
#include <linux/module.h>
#include <linux/xattr.h>
#include <linux/utsname.h>
#include <linux/freezer.h>
#include <linux/iversion.h>

#include "nfs4_fs.h"
#include "delegation.h"
#include "internal.h"
#include "iostat.h"
#include "callback.h"
#include "pnfs.h"
#include "netns.h"
#include "sysfs.h"
#include "nfs4idmap.h"
#include "nfs4session.h"
#include "fscache.h"
#include "nfs42.h"

#include "nfs4trace.h"

#define NFSDBG_FACILITY

#define NFS4_BITMASK_SZ

#define NFS4_POLL_RETRY_MIN
#define NFS4_POLL_RETRY_MAX

/* file attributes which can be mapped to nfs attributes */
#define NFS4_VALID_ATTRS

struct nfs4_opendata;
static int _nfs4_recover_proc_open(struct nfs4_opendata *data);
static int nfs4_do_fsinfo(struct nfs_server *, struct nfs_fh *, struct nfs_fsinfo *);
static void nfs_fixup_referral_attributes(struct nfs_fattr *fattr);
static int _nfs4_proc_getattr(struct nfs_server *server, struct nfs_fh *fhandle,
			      struct nfs_fattr *fattr, struct inode *inode);
static int nfs4_do_setattr(struct inode *inode, const struct cred *cred,
			    struct nfs_fattr *fattr, struct iattr *sattr,
			    struct nfs_open_context *ctx, struct nfs4_label *ilabel);
#ifdef CONFIG_NFS_V4_1
static struct rpc_task *_nfs41_proc_sequence(struct nfs_client *clp,
		const struct cred *cred,
		struct nfs4_slot *slot,
		bool is_privileged);
static int nfs41_test_stateid(struct nfs_server *, const nfs4_stateid *,
			      const struct cred *);
static int nfs41_free_stateid(struct nfs_server *, const nfs4_stateid *,
			      const struct cred *, bool);
#endif

#ifdef CONFIG_NFS_V4_SECURITY_LABEL
static inline struct nfs4_label *
nfs4_label_init_security(struct inode *dir, struct dentry *dentry,
	struct iattr *sattr, struct nfs4_label *label)
{}
static inline void
nfs4_label_release_security(struct nfs4_label *label)
{}
static inline u32 *nfs4_bitmask(struct nfs_server *server, struct nfs4_label *label)
{}
#else
static inline struct nfs4_label *
nfs4_label_init_security(struct inode *dir, struct dentry *dentry,
	struct iattr *sattr, struct nfs4_label *l)
{ return NULL; }
static inline void
nfs4_label_release_security(struct nfs4_label *label)
{ return; }
static inline u32 *
nfs4_bitmask(struct nfs_server *server, struct nfs4_label *label)
{ return server->attr_bitmask; }
#endif

/* Prevent leaks of NFSv4 errors into userland */
static int nfs4_map_errors(int err)
{}

/*
 * This is our standard bitmap for GETATTR requests.
 */
const u32 nfs4_fattr_bitmap[3] =;

static const u32 nfs4_pnfs_open_bitmap[3] =;

static const u32 nfs4_open_noattr_bitmap[3] =;

const u32 nfs4_statfs_bitmap[3] =;

const u32 nfs4_pathconf_bitmap[3] =;

const u32 nfs4_fsinfo_bitmap[3] =;

const u32 nfs4_fs_locations_bitmap[3] =;

static void nfs4_bitmap_copy_adjust(__u32 *dst, const __u32 *src,
				    struct inode *inode, unsigned long flags)
{}

static void nfs4_setup_readdir(u64 cookie, __be32 *verifier, struct dentry *dentry,
		struct nfs4_readdir_arg *readdir)
{}

static void nfs4_fattr_set_prechange(struct nfs_fattr *fattr, u64 version)
{}

static void nfs4_test_and_free_stateid(struct nfs_server *server,
		nfs4_stateid *stateid,
		const struct cred *cred)
{}

static void __nfs4_free_revoked_stateid(struct nfs_server *server,
		nfs4_stateid *stateid,
		const struct cred *cred)
{}

static void nfs4_free_revoked_stateid(struct nfs_server *server,
		const nfs4_stateid *stateid,
		const struct cred *cred)
{}

static long nfs4_update_delay(long *timeout)
{}

static int nfs4_delay_killable(long *timeout)
{}

static int nfs4_delay_interruptible(long *timeout)
{}

static int nfs4_delay(long *timeout, bool interruptible)
{}

static const nfs4_stateid *
nfs4_recoverable_stateid(const nfs4_stateid *stateid)
{}

/* This is the error handling routine for processes that are allowed
 * to sleep.
 */
static int nfs4_do_handle_exception(struct nfs_server *server,
		int errorcode, struct nfs4_exception *exception)
{}

/*
 * Track the number of NFS4ERR_DELAY related retransmissions and return
 * EAGAIN if the 'softerr' mount option is set, and we've exceeded the limit
 * set by 'nfs_delay_retrans'.
 */
static int nfs4_exception_should_retrans(const struct nfs_server *server,
					 struct nfs4_exception *exception)
{}

/* This is the error handling routine for processes that are allowed
 * to sleep.
 */
int nfs4_handle_exception(struct nfs_server *server, int errorcode, struct nfs4_exception *exception)
{}

static int
nfs4_async_handle_exception(struct rpc_task *task, struct nfs_server *server,
		int errorcode, struct nfs4_exception *exception)
{}

int
nfs4_async_handle_error(struct rpc_task *task, struct nfs_server *server,
			struct nfs4_state *state, long *timeout)
{}

/*
 * Return 'true' if 'clp' is using an rpc_client that is integrity protected
 * or 'false' otherwise.
 */
static bool _nfs4_is_integrity_protected(struct nfs_client *clp)
{}

static void do_renew_lease(struct nfs_client *clp, unsigned long timestamp)
{}

static void renew_lease(const struct nfs_server *server, unsigned long timestamp)
{}

struct nfs4_call_sync_data {};

void nfs4_init_sequence(struct nfs4_sequence_args *args,
			struct nfs4_sequence_res *res, int cache_reply,
			int privileged)
{}

static void nfs40_sequence_free_slot(struct nfs4_sequence_res *res)
{}

static int nfs40_sequence_done(struct rpc_task *task,
			       struct nfs4_sequence_res *res)
{}

#if defined(CONFIG_NFS_V4_1)

static void nfs41_release_slot(struct nfs4_slot *slot)
{}

static void nfs41_sequence_free_slot(struct nfs4_sequence_res *res)
{}

static void nfs4_slot_sequence_record_sent(struct nfs4_slot *slot,
		u32 seqnr)
{}
static void nfs4_slot_sequence_acked(struct nfs4_slot *slot, u32 seqnr)
{}

static void nfs4_probe_sequence(struct nfs_client *client, const struct cred *cred,
				struct nfs4_slot *slot)
{}

static int nfs41_sequence_process(struct rpc_task *task,
		struct nfs4_sequence_res *res)
{}

int nfs41_sequence_done(struct rpc_task *task, struct nfs4_sequence_res *res)
{}
EXPORT_SYMBOL_GPL();

static int nfs4_sequence_process(struct rpc_task *task, struct nfs4_sequence_res *res)
{}

static void nfs4_sequence_free_slot(struct nfs4_sequence_res *res)
{}

int nfs4_sequence_done(struct rpc_task *task, struct nfs4_sequence_res *res)
{}
EXPORT_SYMBOL_GPL();

static void nfs41_call_sync_prepare(struct rpc_task *task, void *calldata)
{}

static void nfs41_call_sync_done(struct rpc_task *task, void *calldata)
{}

static const struct rpc_call_ops nfs41_call_sync_ops =;

#else	/* !CONFIG_NFS_V4_1 */

static int nfs4_sequence_process(struct rpc_task *task, struct nfs4_sequence_res *res)
{
	return nfs40_sequence_done(task, res);
}

static void nfs4_sequence_free_slot(struct nfs4_sequence_res *res)
{
	if (res->sr_slot != NULL)
		nfs40_sequence_free_slot(res);
}

int nfs4_sequence_done(struct rpc_task *task,
		       struct nfs4_sequence_res *res)
{
	return nfs40_sequence_done(task, res);
}
EXPORT_SYMBOL_GPL(nfs4_sequence_done);

#endif	/* !CONFIG_NFS_V4_1 */

static void nfs41_sequence_res_init(struct nfs4_sequence_res *res)
{}

static
void nfs4_sequence_attach_slot(struct nfs4_sequence_args *args,
		struct nfs4_sequence_res *res,
		struct nfs4_slot *slot)
{}

int nfs4_setup_sequence(struct nfs_client *client,
			struct nfs4_sequence_args *args,
			struct nfs4_sequence_res *res,
			struct rpc_task *task)
{}
EXPORT_SYMBOL_GPL();

static void nfs40_call_sync_prepare(struct rpc_task *task, void *calldata)
{}

static void nfs40_call_sync_done(struct rpc_task *task, void *calldata)
{}

static const struct rpc_call_ops nfs40_call_sync_ops =;

static int nfs4_call_sync_custom(struct rpc_task_setup *task_setup)
{}

static int nfs4_do_call_sync(struct rpc_clnt *clnt,
			     struct nfs_server *server,
			     struct rpc_message *msg,
			     struct nfs4_sequence_args *args,
			     struct nfs4_sequence_res *res,
			     unsigned short task_flags)
{}

static int nfs4_call_sync_sequence(struct rpc_clnt *clnt,
				   struct nfs_server *server,
				   struct rpc_message *msg,
				   struct nfs4_sequence_args *args,
				   struct nfs4_sequence_res *res)
{}


int nfs4_call_sync(struct rpc_clnt *clnt,
		   struct nfs_server *server,
		   struct rpc_message *msg,
		   struct nfs4_sequence_args *args,
		   struct nfs4_sequence_res *res,
		   int cache_reply)
{}

static void
nfs4_inc_nlink_locked(struct inode *inode)
{}

static void
nfs4_inc_nlink(struct inode *inode)
{}

static void
nfs4_dec_nlink_locked(struct inode *inode)
{}

static void
nfs4_update_changeattr_locked(struct inode *inode,
		struct nfs4_change_info *cinfo,
		unsigned long timestamp, unsigned long cache_validity)
{}

void
nfs4_update_changeattr(struct inode *dir, struct nfs4_change_info *cinfo,
		unsigned long timestamp, unsigned long cache_validity)
{}

struct nfs4_open_createattrs {};

static bool nfs4_clear_cap_atomic_open_v1(struct nfs_server *server,
		int err, struct nfs4_exception *exception)
{}

static fmode_t _nfs4_ctx_to_accessmode(const struct nfs_open_context *ctx)
{}

static fmode_t _nfs4_ctx_to_openmode(const struct nfs_open_context *ctx)
{}

static u32
nfs4_fmode_to_share_access(fmode_t fmode)
{}

static u32
nfs4_map_atomic_open_share(struct nfs_server *server,
		fmode_t fmode, int openflags)
{}

static enum open_claim_type4
nfs4_map_atomic_open_claim(struct nfs_server *server,
		enum open_claim_type4 claim)
{}

static void nfs4_init_opendata_res(struct nfs4_opendata *p)
{}

static struct nfs4_opendata *nfs4_opendata_alloc(struct dentry *dentry,
		struct nfs4_state_owner *sp, fmode_t fmode, int flags,
		const struct nfs4_open_createattrs *c,
		enum open_claim_type4 claim,
		gfp_t gfp_mask)
{}

static void nfs4_opendata_free(struct kref *kref)
{}

static void nfs4_opendata_put(struct nfs4_opendata *p)
{}

static bool nfs4_mode_match_open_stateid(struct nfs4_state *state,
		fmode_t fmode)
{}

static int can_open_cached(struct nfs4_state *state, fmode_t mode,
		int open_mode, enum open_claim_type4 claim)
{}

static int can_open_delegated(struct nfs_delegation *delegation, fmode_t fmode,
		enum open_claim_type4 claim)
{}

static void update_open_stateflags(struct nfs4_state *state, fmode_t fmode)
{}

#ifdef CONFIG_NFS_V4_1
static bool nfs_open_stateid_recover_openmode(struct nfs4_state *state)
{}
#endif /* CONFIG_NFS_V4_1 */

static void nfs_state_log_update_open_stateid(struct nfs4_state *state)
{}

static void nfs_test_and_clear_all_open_stateid(struct nfs4_state *state)
{}

/*
 * Check for whether or not the caller may update the open stateid
 * to the value passed in by stateid.
 *
 * Note: This function relies heavily on the server implementing
 * RFC7530 Section 9.1.4.2, and RFC5661 Section 8.2.2
 * correctly.
 * i.e. The stateid seqids have to be initialised to 1, and
 * are then incremented on every state transition.
 */
static bool nfs_stateid_is_sequential(struct nfs4_state *state,
		const nfs4_stateid *stateid)
{}

static void nfs_resync_open_stateid_locked(struct nfs4_state *state)
{}

static void nfs_clear_open_stateid_locked(struct nfs4_state *state,
		nfs4_stateid *stateid, fmode_t fmode)
{}

static void nfs_clear_open_stateid(struct nfs4_state *state,
	nfs4_stateid *arg_stateid,
	nfs4_stateid *stateid, fmode_t fmode)
{}

static void nfs_set_open_stateid_locked(struct nfs4_state *state,
		const nfs4_stateid *stateid, nfs4_stateid *freeme)
	__must_hold(&state->owner->so_lock)
	__must_hold(&state->seqlock)
	__must_hold(RCU)

{}

static void nfs_state_set_open_stateid(struct nfs4_state *state,
		const nfs4_stateid *open_stateid,
		fmode_t fmode,
		nfs4_stateid *freeme)
{}

static void nfs_state_clear_open_state_flags(struct nfs4_state *state)
{}

static void nfs_state_set_delegation(struct nfs4_state *state,
		const nfs4_stateid *deleg_stateid,
		fmode_t fmode)
{}

static void nfs_state_clear_delegation(struct nfs4_state *state)
{}

int update_open_stateid(struct nfs4_state *state,
		const nfs4_stateid *open_stateid,
		const nfs4_stateid *delegation,
		fmode_t fmode)
{}

static bool nfs4_update_lock_stateid(struct nfs4_lock_state *lsp,
		const nfs4_stateid *stateid)
{}

static void nfs4_return_incompatible_delegation(struct inode *inode, fmode_t fmode)
{}

static struct nfs4_state *nfs4_try_open_cached(struct nfs4_opendata *opendata)
{}

static void
nfs4_process_delegation(struct inode *inode, const struct cred *cred,
			enum open_claim_type4 claim,
			const struct nfs4_open_delegation *delegation)
{}

/*
 * Check the inode attributes against the CLAIM_PREVIOUS returned attributes
 * and update the nfs4_state.
 */
static struct nfs4_state *
_nfs4_opendata_reclaim_to_nfs4_state(struct nfs4_opendata *data)
{}

static struct inode *
nfs4_opendata_get_inode(struct nfs4_opendata *data)
{}

static struct nfs4_state *
nfs4_opendata_find_nfs4_state(struct nfs4_opendata *data)
{}

static struct nfs4_state *
_nfs4_opendata_to_nfs4_state(struct nfs4_opendata *data)
{}

static struct nfs4_state *
nfs4_opendata_to_nfs4_state(struct nfs4_opendata *data)
{}

static struct nfs_open_context *
nfs4_state_find_open_context_mode(struct nfs4_state *state, fmode_t mode)
{}

static struct nfs_open_context *
nfs4_state_find_open_context(struct nfs4_state *state)
{}

static struct nfs4_opendata *nfs4_open_recoverdata_alloc(struct nfs_open_context *ctx,
		struct nfs4_state *state, enum open_claim_type4 claim)
{}

static int nfs4_open_recover_helper(struct nfs4_opendata *opendata,
				    fmode_t fmode)
{}

static int nfs4_open_recover(struct nfs4_opendata *opendata, struct nfs4_state *state)
{}

/*
 * OPEN_RECLAIM:
 * 	reclaim state on the server after a reboot.
 */
static int _nfs4_do_open_reclaim(struct nfs_open_context *ctx, struct nfs4_state *state)
{}

static int nfs4_do_open_reclaim(struct nfs_open_context *ctx, struct nfs4_state *state)
{}

static int nfs4_open_reclaim(struct nfs4_state_owner *sp, struct nfs4_state *state)
{}

static int nfs4_handle_delegation_recall_error(struct nfs_server *server, struct nfs4_state *state, const nfs4_stateid *stateid, struct file_lock *fl, int err)
{}

int nfs4_open_delegation_recall(struct nfs_open_context *ctx,
		struct nfs4_state *state, const nfs4_stateid *stateid)
{}

static void nfs4_open_confirm_prepare(struct rpc_task *task, void *calldata)
{}

static void nfs4_open_confirm_done(struct rpc_task *task, void *calldata)
{}

static void nfs4_open_confirm_release(void *calldata)
{}

static const struct rpc_call_ops nfs4_open_confirm_ops =;

/*
 * Note: On error, nfs4_proc_open_confirm will free the struct nfs4_opendata
 */
static int _nfs4_proc_open_confirm(struct nfs4_opendata *data)
{}

static void nfs4_open_prepare(struct rpc_task *task, void *calldata)
{}

static void nfs4_open_done(struct rpc_task *task, void *calldata)
{}

static void nfs4_open_release(void *calldata)
{}

static const struct rpc_call_ops nfs4_open_ops =;

static int nfs4_run_open_task(struct nfs4_opendata *data,
			      struct nfs_open_context *ctx)
{}

static int _nfs4_recover_proc_open(struct nfs4_opendata *data)
{}

/*
 * Additional permission checks in order to distinguish between an
 * open for read, and an open for execute. This works around the
 * fact that NFSv4 OPEN treats read and execute permissions as being
 * the same.
 * Note that in the non-execute case, we want to turn off permission
 * checking if we just created a new file (POSIX open() semantics).
 */
static int nfs4_opendata_access(const struct cred *cred,
				struct nfs4_opendata *opendata,
				struct nfs4_state *state, fmode_t fmode)
{}

/*
 * Note: On error, nfs4_proc_open will free the struct nfs4_opendata
 */
static int _nfs4_proc_open(struct nfs4_opendata *data,
			   struct nfs_open_context *ctx)
{}

/*
 * OPEN_EXPIRED:
 * 	reclaim state on the server after a network partition.
 * 	Assumes caller holds the appropriate lock
 */
static int _nfs4_open_expired(struct nfs_open_context *ctx, struct nfs4_state *state)
{}

static int nfs4_do_open_expired(struct nfs_open_context *ctx, struct nfs4_state *state)
{}

static int nfs4_open_expired(struct nfs4_state_owner *sp, struct nfs4_state *state)
{}

static void nfs_finish_clear_delegation_stateid(struct nfs4_state *state,
		const nfs4_stateid *stateid)
{}

static void nfs40_clear_delegation_stateid(struct nfs4_state *state)
{}

static int nfs40_open_expired(struct nfs4_state_owner *sp, struct nfs4_state *state)
{}

static int nfs40_test_and_free_expired_stateid(struct nfs_server *server,
					       const nfs4_stateid *stateid,
					       const struct cred *cred)
{}

#if defined(CONFIG_NFS_V4_1)
static int nfs41_test_and_free_expired_stateid(struct nfs_server *server,
					       const nfs4_stateid *stateid,
					       const struct cred *cred)
{}

static int nfs41_check_delegation_stateid(struct nfs4_state *state)
{}

static void nfs41_delegation_recover_stateid(struct nfs4_state *state)
{}

/**
 * nfs41_check_expired_locks - possibly free a lock stateid
 *
 * @state: NFSv4 state for an inode
 *
 * Returns NFS_OK if recovery for this stateid is now finished.
 * Otherwise a negative NFS4ERR value is returned.
 */
static int nfs41_check_expired_locks(struct nfs4_state *state)
{}

/**
 * nfs41_check_open_stateid - possibly free an open stateid
 *
 * @state: NFSv4 state for an inode
 *
 * Returns NFS_OK if recovery for this stateid is now finished.
 * Otherwise a negative NFS4ERR value is returned.
 */
static int nfs41_check_open_stateid(struct nfs4_state *state)
{}

static int nfs41_open_expired(struct nfs4_state_owner *sp, struct nfs4_state *state)
{}
#endif

/*
 * on an EXCLUSIVE create, the server should send back a bitmask with FATTR4-*
 * fields corresponding to attributes that were used to store the verifier.
 * Make sure we clobber those fields in the later setattr call
 */
static unsigned nfs4_exclusive_attrset(struct nfs4_opendata *opendata,
				struct iattr *sattr, struct nfs4_label **label)
{}

static int _nfs4_open_and_get_state(struct nfs4_opendata *opendata,
		struct nfs_open_context *ctx)
{}

/*
 * Returns a referenced nfs4_state
 */
static int _nfs4_do_open(struct inode *dir,
			struct nfs_open_context *ctx,
			int flags,
			const struct nfs4_open_createattrs *c,
			int *opened)
{}


static struct nfs4_state *nfs4_do_open(struct inode *dir,
					struct nfs_open_context *ctx,
					int flags,
					struct iattr *sattr,
					struct nfs4_label *label,
					int *opened)
{}

static int _nfs4_do_setattr(struct inode *inode,
			    struct nfs_setattrargs *arg,
			    struct nfs_setattrres *res,
			    const struct cred *cred,
			    struct nfs_open_context *ctx)
{}

static int nfs4_do_setattr(struct inode *inode, const struct cred *cred,
			   struct nfs_fattr *fattr, struct iattr *sattr,
			   struct nfs_open_context *ctx, struct nfs4_label *ilabel)
{}

static bool
nfs4_wait_on_layoutreturn(struct inode *inode, struct rpc_task *task)
{}

/*
 * Update the seqid of an open stateid
 */
static void nfs4_sync_open_stateid(nfs4_stateid *dst,
		struct nfs4_state *state)
{}

/*
 * Update the seqid of an open stateid after receiving
 * NFS4ERR_OLD_STATEID
 */
static bool nfs4_refresh_open_old_stateid(nfs4_stateid *dst,
		struct nfs4_state *state)
{}

struct nfs4_closedata {};

static void nfs4_free_closedata(void *data)
{}

static void nfs4_close_done(struct rpc_task *task, void *data)
{}

static void nfs4_close_prepare(struct rpc_task *task, void *data)
{}

static const struct rpc_call_ops nfs4_close_ops =;

/* 
 * It is possible for data to be read/written from a mem-mapped file 
 * after the sys_close call (which hits the vfs layer as a flush).
 * This means that we can't safely call nfsv4 close on a file until 
 * the inode is cleared. This in turn means that we are not good
 * NFSv4 citizens - we do not indicate to the server to update the file's 
 * share state even when we are done with one of the three share 
 * stateid's in the inode.
 *
 * NOTE: Caller must be holding the sp->so_owner semaphore!
 */
int nfs4_do_close(struct nfs4_state *state, gfp_t gfp_mask, int wait)
{}

static struct inode *
nfs4_atomic_open(struct inode *dir, struct nfs_open_context *ctx,
		int open_flags, struct iattr *attr, int *opened)
{}

static void nfs4_close_context(struct nfs_open_context *ctx, int is_sync)
{}

#define FATTR4_WORD1_NFS40_MASK
#define FATTR4_WORD2_NFS41_MASK
#define FATTR4_WORD2_NFS42_MASK

static int _nfs4_server_capabilities(struct nfs_server *server, struct nfs_fh *fhandle)
{}

int nfs4_server_capabilities(struct nfs_server *server, struct nfs_fh *fhandle)
{}

static void test_fs_location_for_trunking(struct nfs4_fs_location *location,
					  struct nfs_client *clp,
					  struct nfs_server *server)
{}

static bool _is_same_nfs4_pathname(struct nfs4_pathname *path1,
				   struct nfs4_pathname *path2)
{}

static int _nfs4_discover_trunking(struct nfs_server *server,
				   struct nfs_fh *fhandle)
{}

static int nfs4_discover_trunking(struct nfs_server *server,
				  struct nfs_fh *fhandle)
{}

static int _nfs4_lookup_root(struct nfs_server *server, struct nfs_fh *fhandle,
		struct nfs_fsinfo *info)
{}

static int nfs4_lookup_root(struct nfs_server *server, struct nfs_fh *fhandle,
		struct nfs_fsinfo *info)
{}

static int nfs4_lookup_root_sec(struct nfs_server *server, struct nfs_fh *fhandle,
				struct nfs_fsinfo *info, rpc_authflavor_t flavor)
{}

/*
 * Retry pseudoroot lookup with various security flavors.  We do this when:
 *
 *   NFSv4.0: the PUTROOTFH operation returns NFS4ERR_WRONGSEC
 *   NFSv4.1: the server does not support the SECINFO_NO_NAME operation
 *
 * Returns zero on success, or a negative NFS4ERR value, or a
 * negative errno value.
 */
static int nfs4_find_root_sec(struct nfs_server *server, struct nfs_fh *fhandle,
			      struct nfs_fsinfo *info)
{}

/**
 * nfs4_proc_get_rootfh - get file handle for server's pseudoroot
 * @server: initialized nfs_server handle
 * @fhandle: we fill in the pseudo-fs root file handle
 * @info: we fill in an FSINFO struct
 * @auth_probe: probe the auth flavours
 *
 * Returns zero on success, or a negative errno.
 */
int nfs4_proc_get_rootfh(struct nfs_server *server, struct nfs_fh *fhandle,
			 struct nfs_fsinfo *info,
			 bool auth_probe)
{}

static int nfs4_proc_get_root(struct nfs_server *server, struct nfs_fh *mntfh,
			      struct nfs_fsinfo *info)
{}

/*
 * Get locations and (maybe) other attributes of a referral.
 * Note that we'll actually follow the referral later when
 * we detect fsid mismatch in inode revalidation
 */
static int nfs4_get_referral(struct rpc_clnt *client, struct inode *dir,
			     const struct qstr *name, struct nfs_fattr *fattr,
			     struct nfs_fh *fhandle)
{}

static int _nfs4_proc_getattr(struct nfs_server *server, struct nfs_fh *fhandle,
				struct nfs_fattr *fattr, struct inode *inode)
{}

int nfs4_proc_getattr(struct nfs_server *server, struct nfs_fh *fhandle,
				struct nfs_fattr *fattr, struct inode *inode)
{}

/* 
 * The file is not closed if it is opened due to the a request to change
 * the size of the file. The open call will not be needed once the
 * VFS layer lookup-intents are implemented.
 *
 * Close is called when the inode is destroyed.
 * If we haven't opened the file for O_WRONLY, we
 * need to in the size_change case to obtain a stateid.
 *
 * Got race?
 * Because OPEN is always done by name in nfsv4, it is
 * possible that we opened a different file by the same
 * name.  We can recognize this race condition, but we
 * can't do anything about it besides returning an error.
 *
 * This will be fixed with VFS changes (lookup-intent).
 */
static int
nfs4_proc_setattr(struct dentry *dentry, struct nfs_fattr *fattr,
		  struct iattr *sattr)
{}

static int _nfs4_proc_lookup(struct rpc_clnt *clnt, struct inode *dir,
		struct dentry *dentry, struct nfs_fh *fhandle,
		struct nfs_fattr *fattr)
{}

static void nfs_fixup_secinfo_attributes(struct nfs_fattr *fattr)
{}

static int nfs4_proc_lookup_common(struct rpc_clnt **clnt, struct inode *dir,
				   struct dentry *dentry, struct nfs_fh *fhandle,
				   struct nfs_fattr *fattr)
{}

static int nfs4_proc_lookup(struct inode *dir, struct dentry *dentry,
			    struct nfs_fh *fhandle, struct nfs_fattr *fattr)
{}

struct rpc_clnt *
nfs4_proc_lookup_mountpoint(struct inode *dir, struct dentry *dentry,
			    struct nfs_fh *fhandle, struct nfs_fattr *fattr)
{}

static int _nfs4_proc_lookupp(struct inode *inode,
		struct nfs_fh *fhandle, struct nfs_fattr *fattr)
{}

static int nfs4_proc_lookupp(struct inode *inode, struct nfs_fh *fhandle,
			     struct nfs_fattr *fattr)
{}

static int _nfs4_proc_access(struct inode *inode, struct nfs_access_entry *entry,
			     const struct cred *cred)
{}

static int nfs4_proc_access(struct inode *inode, struct nfs_access_entry *entry,
			    const struct cred *cred)
{}

/*
 * TODO: For the time being, we don't try to get any attributes
 * along with any of the zero-copy operations READ, READDIR,
 * READLINK, WRITE.
 *
 * In the case of the first three, we want to put the GETATTR
 * after the read-type operation -- this is because it is hard
 * to predict the length of a GETATTR response in v4, and thus
 * align the READ data correctly.  This means that the GETATTR
 * may end up partially falling into the page cache, and we should
 * shift it into the 'tail' of the xdr_buf before processing.
 * To do this efficiently, we need to know the total length
 * of data received, which doesn't seem to be available outside
 * of the RPC layer.
 *
 * In the case of WRITE, we also want to put the GETATTR after
 * the operation -- in this case because we want to make sure
 * we get the post-operation mtime and size.
 *
 * Both of these changes to the XDR layer would in fact be quite
 * minor, but I decided to leave them for a subsequent patch.
 */
static int _nfs4_proc_readlink(struct inode *inode, struct page *page,
		unsigned int pgbase, unsigned int pglen)
{}

static int nfs4_proc_readlink(struct inode *inode, struct page *page,
		unsigned int pgbase, unsigned int pglen)
{}

/*
 * This is just for mknod.  open(O_CREAT) will always do ->open_context().
 */
static int
nfs4_proc_create(struct inode *dir, struct dentry *dentry, struct iattr *sattr,
		 int flags)
{}

static int
_nfs4_proc_remove(struct inode *dir, const struct qstr *name, u32 ftype)
{}

static int nfs4_proc_remove(struct inode *dir, struct dentry *dentry)
{}

static int nfs4_proc_rmdir(struct inode *dir, const struct qstr *name)
{}

static void nfs4_proc_unlink_setup(struct rpc_message *msg,
		struct dentry *dentry,
		struct inode *inode)
{}

static void nfs4_proc_unlink_rpc_prepare(struct rpc_task *task, struct nfs_unlinkdata *data)
{}

static int nfs4_proc_unlink_done(struct rpc_task *task, struct inode *dir)
{}

static void nfs4_proc_rename_setup(struct rpc_message *msg,
		struct dentry *old_dentry,
		struct dentry *new_dentry)
{}

static void nfs4_proc_rename_rpc_prepare(struct rpc_task *task, struct nfs_renamedata *data)
{}

static int nfs4_proc_rename_done(struct rpc_task *task, struct inode *old_dir,
				 struct inode *new_dir)
{}

static int _nfs4_proc_link(struct inode *inode, struct inode *dir, const struct qstr *name)
{}

static int nfs4_proc_link(struct inode *inode, struct inode *dir, const struct qstr *name)
{}

struct nfs4_createdata {};

static struct nfs4_createdata *nfs4_alloc_createdata(struct inode *dir,
		const struct qstr *name, struct iattr *sattr, u32 ftype)
{}

static int nfs4_do_create(struct inode *dir, struct dentry *dentry, struct nfs4_createdata *data)
{}

static void nfs4_free_createdata(struct nfs4_createdata *data)
{}

static int _nfs4_proc_symlink(struct inode *dir, struct dentry *dentry,
		struct folio *folio, unsigned int len, struct iattr *sattr,
		struct nfs4_label *label)
{}

static int nfs4_proc_symlink(struct inode *dir, struct dentry *dentry,
		struct folio *folio, unsigned int len, struct iattr *sattr)
{}

static int _nfs4_proc_mkdir(struct inode *dir, struct dentry *dentry,
		struct iattr *sattr, struct nfs4_label *label)
{}

static int nfs4_proc_mkdir(struct inode *dir, struct dentry *dentry,
		struct iattr *sattr)
{}

static int _nfs4_proc_readdir(struct nfs_readdir_arg *nr_arg,
			      struct nfs_readdir_res *nr_res)
{}

static int nfs4_proc_readdir(struct nfs_readdir_arg *arg,
			     struct nfs_readdir_res *res)
{}

static int _nfs4_proc_mknod(struct inode *dir, struct dentry *dentry,
		struct iattr *sattr, struct nfs4_label *label, dev_t rdev)
{}

static int nfs4_proc_mknod(struct inode *dir, struct dentry *dentry,
		struct iattr *sattr, dev_t rdev)
{}

static int _nfs4_proc_statfs(struct nfs_server *server, struct nfs_fh *fhandle,
		 struct nfs_fsstat *fsstat)
{}

static int nfs4_proc_statfs(struct nfs_server *server, struct nfs_fh *fhandle, struct nfs_fsstat *fsstat)
{}

static int _nfs4_do_fsinfo(struct nfs_server *server, struct nfs_fh *fhandle,
		struct nfs_fsinfo *fsinfo)
{}

static int nfs4_do_fsinfo(struct nfs_server *server, struct nfs_fh *fhandle, struct nfs_fsinfo *fsinfo)
{}

static int nfs4_proc_fsinfo(struct nfs_server *server, struct nfs_fh *fhandle, struct nfs_fsinfo *fsinfo)
{}

static int _nfs4_proc_pathconf(struct nfs_server *server, struct nfs_fh *fhandle,
		struct nfs_pathconf *pathconf)
{}

static int nfs4_proc_pathconf(struct nfs_server *server, struct nfs_fh *fhandle,
		struct nfs_pathconf *pathconf)
{}

int nfs4_set_rw_stateid(nfs4_stateid *stateid,
		const struct nfs_open_context *ctx,
		const struct nfs_lock_context *l_ctx,
		fmode_t fmode)
{}
EXPORT_SYMBOL_GPL();

static bool nfs4_stateid_is_current(nfs4_stateid *stateid,
		const struct nfs_open_context *ctx,
		const struct nfs_lock_context *l_ctx,
		fmode_t fmode)
{}

static bool nfs4_error_stateid_expired(int err)
{}

static int nfs4_read_done_cb(struct rpc_task *task, struct nfs_pgio_header *hdr)
{}

static bool nfs4_read_stateid_changed(struct rpc_task *task,
		struct nfs_pgio_args *args)
{}

static bool nfs4_read_plus_not_supported(struct rpc_task *task,
					 struct nfs_pgio_header *hdr)
{}

static int nfs4_read_done(struct rpc_task *task, struct nfs_pgio_header *hdr)
{}

#if defined CONFIG_NFS_V4_2 && defined CONFIG_NFS_V4_2_READ_PLUS
static bool nfs42_read_plus_support(struct nfs_pgio_header *hdr,
				    struct rpc_message *msg)
{}
#else
static bool nfs42_read_plus_support(struct nfs_pgio_header *hdr,
				    struct rpc_message *msg)
{
	return false;
}
#endif /* CONFIG_NFS_V4_2 */

static void nfs4_proc_read_setup(struct nfs_pgio_header *hdr,
				 struct rpc_message *msg)
{}

static int nfs4_proc_pgio_rpc_prepare(struct rpc_task *task,
				      struct nfs_pgio_header *hdr)
{}

static int nfs4_write_done_cb(struct rpc_task *task,
			      struct nfs_pgio_header *hdr)
{}

static bool nfs4_write_stateid_changed(struct rpc_task *task,
		struct nfs_pgio_args *args)
{}

static int nfs4_write_done(struct rpc_task *task, struct nfs_pgio_header *hdr)
{}

static
bool nfs4_write_need_cache_consistency_data(struct nfs_pgio_header *hdr)
{}

void nfs4_bitmask_set(__u32 bitmask[], const __u32 src[],
		      struct inode *inode, unsigned long cache_validity)
{}

static void nfs4_proc_write_setup(struct nfs_pgio_header *hdr,
				  struct rpc_message *msg,
				  struct rpc_clnt **clnt)
{}

static void nfs4_proc_commit_rpc_prepare(struct rpc_task *task, struct nfs_commit_data *data)
{}

static int nfs4_commit_done_cb(struct rpc_task *task, struct nfs_commit_data *data)
{}

static int nfs4_commit_done(struct rpc_task *task, struct nfs_commit_data *data)
{}

static void nfs4_proc_commit_setup(struct nfs_commit_data *data, struct rpc_message *msg,
				   struct rpc_clnt **clnt)
{}

static int _nfs4_proc_commit(struct file *dst, struct nfs_commitargs *args,
				struct nfs_commitres *res)
{}

int nfs4_proc_commit(struct file *dst, __u64 offset, __u32 count, struct nfs_commitres *res)
{}

struct nfs4_renewdata {};

/*
 * nfs4_proc_async_renew(): This is not one of the nfs_rpc_ops; it is a special
 * standalone procedure for queueing an asynchronous RENEW.
 */
static void nfs4_renew_release(void *calldata)
{}

static void nfs4_renew_done(struct rpc_task *task, void *calldata)
{}

static const struct rpc_call_ops nfs4_renew_ops =;

static int nfs4_proc_async_renew(struct nfs_client *clp, const struct cred *cred, unsigned renew_flags)
{}

static int nfs4_proc_renew(struct nfs_client *clp, const struct cred *cred)
{}

static bool nfs4_server_supports_acls(const struct nfs_server *server,
				      enum nfs4_acl_type type)
{}

/* Assuming that XATTR_SIZE_MAX is a multiple of PAGE_SIZE, and that
 * it's OK to put sizeof(void) * (XATTR_SIZE_MAX/PAGE_SIZE) bytes on
 * the stack.
 */
#define NFS4ACL_MAXPAGES

int nfs4_buf_to_pages_noslab(const void *buf, size_t buflen,
		struct page **pages)
{}

struct nfs4_cached_acl {};

static void nfs4_set_cached_acl(struct inode *inode, struct nfs4_cached_acl *acl)
{}

static void nfs4_zap_acl_attr(struct inode *inode)
{}

static ssize_t nfs4_read_cached_acl(struct inode *inode, char *buf,
				    size_t buflen, enum nfs4_acl_type type)
{}

static void nfs4_write_cached_acl(struct inode *inode, struct page **pages,
				  size_t pgbase, size_t acl_len,
				  enum nfs4_acl_type type)
{}

/*
 * The getxattr API returns the required buffer length when called with a
 * NULL buf. The NFSv4 acl tool then calls getxattr again after allocating
 * the required buf.  On a NULL buf, we send a page of data to the server
 * guessing that the ACL request can be serviced by a page. If so, we cache
 * up to the page of ACL data, and the 2nd call to getxattr is serviced by
 * the cache. If not so, we throw away the page, and cache the required
 * length. The next getxattr call will then produce another round trip to
 * the server, this time with the input buf of the required size.
 */
static ssize_t __nfs4_get_acl_uncached(struct inode *inode, void *buf,
				       size_t buflen, enum nfs4_acl_type type)
{}

static ssize_t nfs4_get_acl_uncached(struct inode *inode, void *buf,
				     size_t buflen, enum nfs4_acl_type type)
{}

static ssize_t nfs4_proc_get_acl(struct inode *inode, void *buf, size_t buflen,
				 enum nfs4_acl_type type)
{}

static int __nfs4_proc_set_acl(struct inode *inode, const void *buf,
			       size_t buflen, enum nfs4_acl_type type)
{}

static int nfs4_proc_set_acl(struct inode *inode, const void *buf,
			     size_t buflen, enum nfs4_acl_type type)
{}

#ifdef CONFIG_NFS_V4_SECURITY_LABEL
static int _nfs4_get_security_label(struct inode *inode, void *buf,
					size_t buflen)
{}

static int nfs4_get_security_label(struct inode *inode, void *buf,
					size_t buflen)
{}

static int _nfs4_do_set_security_label(struct inode *inode,
		struct nfs4_label *ilabel,
		struct nfs_fattr *fattr)
{}

static int nfs4_do_set_security_label(struct inode *inode,
		struct nfs4_label *ilabel,
		struct nfs_fattr *fattr)
{}

static int
nfs4_set_security_label(struct inode *inode, const void *buf, size_t buflen)
{}
#endif	/* CONFIG_NFS_V4_SECURITY_LABEL */


static void nfs4_init_boot_verifier(const struct nfs_client *clp,
				    nfs4_verifier *bootverf)
{}

static size_t
nfs4_get_uniquifier(struct nfs_client *clp, char *buf, size_t buflen)
{}

static int
nfs4_init_nonuniform_client_string(struct nfs_client *clp)
{}

static int
nfs4_init_uniform_client_string(struct nfs_client *clp)
{}

/*
 * nfs4_callback_up_net() starts only "tcp" and "tcp6" callback
 * services.  Advertise one based on the address family of the
 * clientaddr.
 */
static unsigned int
nfs4_init_callback_netid(const struct nfs_client *clp, char *buf, size_t len)
{}

static void nfs4_setclientid_done(struct rpc_task *task, void *calldata)
{}

static const struct rpc_call_ops nfs4_setclientid_ops =;

/**
 * nfs4_proc_setclientid - Negotiate client ID
 * @clp: state data structure
 * @program: RPC program for NFSv4 callback service
 * @port: IP port number for NFS4 callback service
 * @cred: credential to use for this call
 * @res: where to place the result
 *
 * Returns zero, a negative errno, or a negative NFS4ERR status code.
 */
int nfs4_proc_setclientid(struct nfs_client *clp, u32 program,
		unsigned short port, const struct cred *cred,
		struct nfs4_setclientid_res *res)
{}

/**
 * nfs4_proc_setclientid_confirm - Confirm client ID
 * @clp: state data structure
 * @arg: result of a previous SETCLIENTID
 * @cred: credential to use for this call
 *
 * Returns zero, a negative errno, or a negative NFS4ERR status code.
 */
int nfs4_proc_setclientid_confirm(struct nfs_client *clp,
		struct nfs4_setclientid_res *arg,
		const struct cred *cred)
{}

struct nfs4_delegreturndata {};

static void nfs4_delegreturn_done(struct rpc_task *task, void *calldata)
{}

static void nfs4_delegreturn_release(void *calldata)
{}

static void nfs4_delegreturn_prepare(struct rpc_task *task, void *data)
{}

static const struct rpc_call_ops nfs4_delegreturn_ops =;

static int _nfs4_proc_delegreturn(struct inode *inode, const struct cred *cred,
				  const nfs4_stateid *stateid,
				  struct nfs_delegation *delegation,
				  int issync)
{}

int nfs4_proc_delegreturn(struct inode *inode, const struct cred *cred,
			  const nfs4_stateid *stateid,
			  struct nfs_delegation *delegation, int issync)
{}

static int _nfs4_proc_getlk(struct nfs4_state *state, int cmd, struct file_lock *request)
{}

static int nfs4_proc_getlk(struct nfs4_state *state, int cmd, struct file_lock *request)
{}

/*
 * Update the seqid of a lock stateid after receiving
 * NFS4ERR_OLD_STATEID
 */
static bool nfs4_refresh_lock_old_stateid(nfs4_stateid *dst,
		struct nfs4_lock_state *lsp)
{}

static bool nfs4_sync_lock_stateid(nfs4_stateid *dst,
		struct nfs4_lock_state *lsp)
{}

struct nfs4_unlockdata {};

static struct nfs4_unlockdata *nfs4_alloc_unlockdata(struct file_lock *fl,
		struct nfs_open_context *ctx,
		struct nfs4_lock_state *lsp,
		struct nfs_seqid *seqid)
{}

static void nfs4_locku_release_calldata(void *data)
{}

static void nfs4_locku_done(struct rpc_task *task, void *data)
{}

static void nfs4_locku_prepare(struct rpc_task *task, void *data)
{}

static const struct rpc_call_ops nfs4_locku_ops =;

static struct rpc_task *nfs4_do_unlck(struct file_lock *fl,
		struct nfs_open_context *ctx,
		struct nfs4_lock_state *lsp,
		struct nfs_seqid *seqid)
{}

static int nfs4_proc_unlck(struct nfs4_state *state, int cmd, struct file_lock *request)
{}

struct nfs4_lockdata {};

static struct nfs4_lockdata *nfs4_alloc_lockdata(struct file_lock *fl,
		struct nfs_open_context *ctx, struct nfs4_lock_state *lsp,
		gfp_t gfp_mask)
{}

static void nfs4_lock_prepare(struct rpc_task *task, void *calldata)
{}

static void nfs4_lock_done(struct rpc_task *task, void *calldata)
{}

static void nfs4_lock_release(void *calldata)
{}

static const struct rpc_call_ops nfs4_lock_ops =;

static void nfs4_handle_setlk_error(struct nfs_server *server, struct nfs4_lock_state *lsp, int new_lock_owner, int error)
{}

static int _nfs4_do_setlk(struct nfs4_state *state, int cmd, struct file_lock *fl, int recovery_type)
{}

static int nfs4_lock_reclaim(struct nfs4_state *state, struct file_lock *request)
{}

static int nfs4_lock_expired(struct nfs4_state *state, struct file_lock *request)
{}

#if defined(CONFIG_NFS_V4_1)
static int nfs41_lock_expired(struct nfs4_state *state, struct file_lock *request)
{}
#endif

static int _nfs4_proc_setlk(struct nfs4_state *state, int cmd, struct file_lock *request)
{}

static int nfs4_proc_setlk(struct nfs4_state *state, int cmd, struct file_lock *request)
{}

#define NFS4_LOCK_MINTIMEOUT
#define NFS4_LOCK_MAXTIMEOUT

static int
nfs4_retry_setlk_simple(struct nfs4_state *state, int cmd,
			struct file_lock *request)
{}

#ifdef CONFIG_NFS_V4_1
struct nfs4_lock_waiter {};

static int
nfs4_wake_lock_waiter(wait_queue_entry_t *wait, unsigned int mode, int flags, void *key)
{}

static int
nfs4_retry_setlk(struct nfs4_state *state, int cmd, struct file_lock *request)
{}
#else /* !CONFIG_NFS_V4_1 */
static inline int
nfs4_retry_setlk(struct nfs4_state *state, int cmd, struct file_lock *request)
{
	return nfs4_retry_setlk_simple(state, cmd, request);
}
#endif

static int
nfs4_proc_lock(struct file *filp, int cmd, struct file_lock *request)
{}

static int nfs4_delete_lease(struct file *file, void **priv)
{}

static int nfs4_add_lease(struct file *file, int arg, struct file_lease **lease,
			  void **priv)
{}

int nfs4_proc_setlease(struct file *file, int arg, struct file_lease **lease,
		       void **priv)
{}

int nfs4_lock_delegation_recall(struct file_lock *fl, struct nfs4_state *state, const nfs4_stateid *stateid)
{}

struct nfs_release_lockowner_data {};

static void nfs4_release_lockowner_prepare(struct rpc_task *task, void *calldata)
{}

static void nfs4_release_lockowner_done(struct rpc_task *task, void *calldata)
{}

static void nfs4_release_lockowner_release(void *calldata)
{}

static const struct rpc_call_ops nfs4_release_lockowner_ops =;

static void
nfs4_release_lockowner(struct nfs_server *server, struct nfs4_lock_state *lsp)
{}

#define XATTR_NAME_NFSV4_ACL

static int nfs4_xattr_set_nfs4_acl(const struct xattr_handler *handler,
				   struct mnt_idmap *idmap,
				   struct dentry *unused, struct inode *inode,
				   const char *key, const void *buf,
				   size_t buflen, int flags)
{}

static int nfs4_xattr_get_nfs4_acl(const struct xattr_handler *handler,
				   struct dentry *unused, struct inode *inode,
				   const char *key, void *buf, size_t buflen)
{}

static bool nfs4_xattr_list_nfs4_acl(struct dentry *dentry)
{}

#if defined(CONFIG_NFS_V4_1)
#define XATTR_NAME_NFSV4_DACL

static int nfs4_xattr_set_nfs4_dacl(const struct xattr_handler *handler,
				    struct mnt_idmap *idmap,
				    struct dentry *unused, struct inode *inode,
				    const char *key, const void *buf,
				    size_t buflen, int flags)
{}

static int nfs4_xattr_get_nfs4_dacl(const struct xattr_handler *handler,
				    struct dentry *unused, struct inode *inode,
				    const char *key, void *buf, size_t buflen)
{}

static bool nfs4_xattr_list_nfs4_dacl(struct dentry *dentry)
{}

#define XATTR_NAME_NFSV4_SACL

static int nfs4_xattr_set_nfs4_sacl(const struct xattr_handler *handler,
				    struct mnt_idmap *idmap,
				    struct dentry *unused, struct inode *inode,
				    const char *key, const void *buf,
				    size_t buflen, int flags)
{}

static int nfs4_xattr_get_nfs4_sacl(const struct xattr_handler *handler,
				    struct dentry *unused, struct inode *inode,
				    const char *key, void *buf, size_t buflen)
{}

static bool nfs4_xattr_list_nfs4_sacl(struct dentry *dentry)
{}

#endif

#ifdef CONFIG_NFS_V4_SECURITY_LABEL

static int nfs4_xattr_set_nfs4_label(const struct xattr_handler *handler,
				     struct mnt_idmap *idmap,
				     struct dentry *unused, struct inode *inode,
				     const char *key, const void *buf,
				     size_t buflen, int flags)
{}

static int nfs4_xattr_get_nfs4_label(const struct xattr_handler *handler,
				     struct dentry *unused, struct inode *inode,
				     const char *key, void *buf, size_t buflen)
{}

static ssize_t
nfs4_listxattr_nfs4_label(struct inode *inode, char *list, size_t list_len)
{}

static const struct xattr_handler nfs4_xattr_nfs4_label_handler =;

#else

static ssize_t
nfs4_listxattr_nfs4_label(struct inode *inode, char *list, size_t list_len)
{
	return 0;
}

#endif

#ifdef CONFIG_NFS_V4_2
static int nfs4_xattr_set_nfs4_user(const struct xattr_handler *handler,
				    struct mnt_idmap *idmap,
				    struct dentry *unused, struct inode *inode,
				    const char *key, const void *buf,
				    size_t buflen, int flags)
{}

static int nfs4_xattr_get_nfs4_user(const struct xattr_handler *handler,
				    struct dentry *unused, struct inode *inode,
				    const char *key, void *buf, size_t buflen)
{}

static ssize_t
nfs4_listxattr_nfs4_user(struct inode *inode, char *list, size_t list_len)
{}

#else

static ssize_t
nfs4_listxattr_nfs4_user(struct inode *inode, char *list, size_t list_len)
{
	return 0;
}
#endif /* CONFIG_NFS_V4_2 */

/*
 * nfs_fhget will use either the mounted_on_fileid or the fileid
 */
static void nfs_fixup_referral_attributes(struct nfs_fattr *fattr)
{}

static int _nfs4_proc_fs_locations(struct rpc_clnt *client, struct inode *dir,
				   const struct qstr *name,
				   struct nfs4_fs_locations *fs_locations,
				   struct page *page)
{}

int nfs4_proc_fs_locations(struct rpc_clnt *client, struct inode *dir,
			   const struct qstr *name,
			   struct nfs4_fs_locations *fs_locations,
			   struct page *page)
{}

/*
 * This operation also signals the server that this client is
 * performing migration recovery.  The server can stop returning
 * NFS4ERR_LEASE_MOVED to this client.  A RENEW operation is
 * appended to this compound to identify the client ID which is
 * performing recovery.
 */
static int _nfs40_proc_get_locations(struct nfs_server *server,
				     struct nfs_fh *fhandle,
				     struct nfs4_fs_locations *locations,
				     struct page *page, const struct cred *cred)
{}

#ifdef CONFIG_NFS_V4_1

/*
 * This operation also signals the server that this client is
 * performing migration recovery.  The server can stop asserting
 * SEQ4_STATUS_LEASE_MOVED for this client.  The client ID
 * performing this operation is identified in the SEQUENCE
 * operation in this compound.
 *
 * When the client supports GETATTR(fs_locations_info), it can
 * be plumbed in here.
 */
static int _nfs41_proc_get_locations(struct nfs_server *server,
				     struct nfs_fh *fhandle,
				     struct nfs4_fs_locations *locations,
				     struct page *page, const struct cred *cred)
{}

#endif	/* CONFIG_NFS_V4_1 */

/**
 * nfs4_proc_get_locations - discover locations for a migrated FSID
 * @server: pointer to nfs_server to process
 * @fhandle: pointer to the kernel NFS client file handle
 * @locations: result of query
 * @page: buffer
 * @cred: credential to use for this operation
 *
 * Returns NFS4_OK on success, a negative NFS4ERR status code if the
 * operation failed, or a negative errno if a local error occurred.
 *
 * On success, "locations" is filled in, but if the server has
 * no locations information, NFS_ATTR_FATTR_V4_LOCATIONS is not
 * asserted.
 *
 * -NFS4ERR_LEASE_MOVED is returned if the server still has leases
 * from this client that require migration recovery.
 */
int nfs4_proc_get_locations(struct nfs_server *server,
			    struct nfs_fh *fhandle,
			    struct nfs4_fs_locations *locations,
			    struct page *page, const struct cred *cred)
{}

/*
 * This operation also signals the server that this client is
 * performing "lease moved" recovery.  The server can stop
 * returning NFS4ERR_LEASE_MOVED to this client.  A RENEW operation
 * is appended to this compound to identify the client ID which is
 * performing recovery.
 */
static int _nfs40_proc_fsid_present(struct inode *inode, const struct cred *cred)
{}

#ifdef CONFIG_NFS_V4_1

/*
 * This operation also signals the server that this client is
 * performing "lease moved" recovery.  The server can stop asserting
 * SEQ4_STATUS_LEASE_MOVED for this client.  The client ID performing
 * this operation is identified in the SEQUENCE operation in this
 * compound.
 */
static int _nfs41_proc_fsid_present(struct inode *inode, const struct cred *cred)
{}

#endif	/* CONFIG_NFS_V4_1 */

/**
 * nfs4_proc_fsid_present - Is this FSID present or absent on server?
 * @inode: inode on FSID to check
 * @cred: credential to use for this operation
 *
 * Server indicates whether the FSID is present, moved, or not
 * recognized.  This operation is necessary to clear a LEASE_MOVED
 * condition for this client ID.
 *
 * Returns NFS4_OK if the FSID is present on this server,
 * -NFS4ERR_MOVED if the FSID is no longer present, a negative
 *  NFS4ERR code if some error occurred on the server, or a
 *  negative errno if a local failure occurred.
 */
int nfs4_proc_fsid_present(struct inode *inode, const struct cred *cred)
{}

/*
 * If 'use_integrity' is true and the state managment nfs_client
 * cl_rpcclient is using krb5i/p, use the integrity protected cl_rpcclient
 * and the machine credential as per RFC3530bis and RFC5661 Security
 * Considerations sections. Otherwise, just use the user cred with the
 * filesystem's rpc_client.
 */
static int _nfs4_proc_secinfo(struct inode *dir, const struct qstr *name, struct nfs4_secinfo_flavors *flavors, bool use_integrity)
{}

int nfs4_proc_secinfo(struct inode *dir, const struct qstr *name,
		      struct nfs4_secinfo_flavors *flavors)
{}

#ifdef CONFIG_NFS_V4_1
/*
 * Check the exchange flags returned by the server for invalid flags, having
 * both PNFS and NON_PNFS flags set, and not having one of NON_PNFS, PNFS, or
 * DS flags set.
 */
static int nfs4_check_cl_exchange_flags(u32 flags, u32 version)
{}

static bool
nfs41_same_server_scope(struct nfs41_server_scope *a,
			struct nfs41_server_scope *b)
{}

static void
nfs4_bind_one_conn_to_session_done(struct rpc_task *task, void *calldata)
{}

static const struct rpc_call_ops nfs4_bind_one_conn_to_session_ops =;

/*
 * nfs4_proc_bind_one_conn_to_session()
 *
 * The 4.1 client currently uses the same TCP connection for the
 * fore and backchannel.
 */
static
int nfs4_proc_bind_one_conn_to_session(struct rpc_clnt *clnt,
		struct rpc_xprt *xprt,
		struct nfs_client *clp,
		const struct cred *cred)
{}

struct rpc_bind_conn_calldata {};

static int
nfs4_proc_bind_conn_to_session_callback(struct rpc_clnt *clnt,
		struct rpc_xprt *xprt,
		void *calldata)
{}

int nfs4_proc_bind_conn_to_session(struct nfs_client *clp, const struct cred *cred)
{}

/*
 * Minimum set of SP4_MACH_CRED operations from RFC 5661 in the enforce map
 * and operations we'd like to see to enable certain features in the allow map
 */
static const struct nfs41_state_protection nfs4_sp4_mach_cred_request =;

/*
 * Select the state protection mode for client `clp' given the server results
 * from exchange_id in `sp'.
 *
 * Returns 0 on success, negative errno otherwise.
 */
static int nfs4_sp4_select_mode(struct nfs_client *clp,
				 struct nfs41_state_protection *sp)
{}

struct nfs41_exchange_id_data {};

static void nfs4_exchange_id_release(void *data)
{}

static const struct rpc_call_ops nfs4_exchange_id_call_ops =;

/*
 * _nfs4_proc_exchange_id()
 *
 * Wrapper for EXCHANGE_ID operation.
 */
static struct rpc_task *
nfs4_run_exchange_id(struct nfs_client *clp, const struct cred *cred,
			u32 sp4_how, struct rpc_xprt *xprt)
{}

/*
 * _nfs4_proc_exchange_id()
 *
 * Wrapper for EXCHANGE_ID operation.
 */
static int _nfs4_proc_exchange_id(struct nfs_client *clp, const struct cred *cred,
			u32 sp4_how)
{}

/*
 * nfs4_proc_exchange_id()
 *
 * Returns zero, a negative errno, or a negative NFS4ERR status code.
 *
 * Since the clientid has expired, all compounds using sessions
 * associated with the stale clientid will be returning
 * NFS4ERR_BADSESSION in the sequence operation, and will therefore
 * be in some phase of session reset.
 *
 * Will attempt to negotiate SP4_MACH_CRED if krb5i / krb5p auth is used.
 */
int nfs4_proc_exchange_id(struct nfs_client *clp, const struct cred *cred)
{}

/**
 * nfs4_test_session_trunk
 *
 * This is an add_xprt_test() test function called from
 * rpc_clnt_setup_test_and_add_xprt.
 *
 * The rpc_xprt_switch is referrenced by rpc_clnt_setup_test_and_add_xprt
 * and is dereferrenced in nfs4_exchange_id_release
 *
 * Upon success, add the new transport to the rpc_clnt
 *
 * @clnt: struct rpc_clnt to get new transport
 * @xprt: the rpc_xprt to test
 * @data: call data for _nfs4_proc_exchange_id.
 */
void nfs4_test_session_trunk(struct rpc_clnt *clnt, struct rpc_xprt *xprt,
			    void *data)
{}
EXPORT_SYMBOL_GPL();

static int _nfs4_proc_destroy_clientid(struct nfs_client *clp,
		const struct cred *cred)
{}

static int nfs4_proc_destroy_clientid(struct nfs_client *clp,
		const struct cred *cred)
{}

int nfs4_destroy_clientid(struct nfs_client *clp)
{}

#endif /* CONFIG_NFS_V4_1 */

struct nfs4_get_lease_time_data {};

static void nfs4_get_lease_time_prepare(struct rpc_task *task,
					void *calldata)
{}

/*
 * Called from nfs4_state_manager thread for session setup, so don't recover
 * from sequence operation or clientid errors.
 */
static void nfs4_get_lease_time_done(struct rpc_task *task, void *calldata)
{}

static const struct rpc_call_ops nfs4_get_lease_time_ops =;

int nfs4_proc_get_lease_time(struct nfs_client *clp, struct nfs_fsinfo *fsinfo)
{}

#ifdef CONFIG_NFS_V4_1

/*
 * Initialize the values to be used by the client in CREATE_SESSION
 * If nfs4_init_session set the fore channel request and response sizes,
 * use them.
 *
 * Set the back channel max_resp_sz_cached to zero to force the client to
 * always set csa_cachethis to FALSE because the current implementation
 * of the back channel DRC only supports caching the CB_SEQUENCE operation.
 */
static void nfs4_init_channel_attrs(struct nfs41_create_session_args *args,
				    struct rpc_clnt *clnt)
{}

static int nfs4_verify_fore_channel_attrs(struct nfs41_create_session_args *args,
		struct nfs41_create_session_res *res)
{}

static int nfs4_verify_back_channel_attrs(struct nfs41_create_session_args *args,
		struct nfs41_create_session_res *res)
{}

static int nfs4_verify_channel_attrs(struct nfs41_create_session_args *args,
				     struct nfs41_create_session_res *res)
{}

static void nfs4_update_session(struct nfs4_session *session,
		struct nfs41_create_session_res *res)
{}

static int _nfs4_proc_create_session(struct nfs_client *clp,
		const struct cred *cred)
{}

/*
 * Issues a CREATE_SESSION operation to the server.
 * It is the responsibility of the caller to verify the session is
 * expired before calling this routine.
 */
int nfs4_proc_create_session(struct nfs_client *clp, const struct cred *cred)
{}

/*
 * Issue the over-the-wire RPC DESTROY_SESSION.
 * The caller must serialize access to this routine.
 */
int nfs4_proc_destroy_session(struct nfs4_session *session,
		const struct cred *cred)
{}

/*
 * Renew the cl_session lease.
 */
struct nfs4_sequence_data {};

static void nfs41_sequence_release(void *data)
{}

static int nfs41_sequence_handle_errors(struct rpc_task *task, struct nfs_client *clp)
{}

static void nfs41_sequence_call_done(struct rpc_task *task, void *data)
{}

static void nfs41_sequence_prepare(struct rpc_task *task, void *data)
{}

static const struct rpc_call_ops nfs41_sequence_ops =;

static struct rpc_task *_nfs41_proc_sequence(struct nfs_client *clp,
		const struct cred *cred,
		struct nfs4_slot *slot,
		bool is_privileged)
{}

static int nfs41_proc_async_sequence(struct nfs_client *clp, const struct cred *cred, unsigned renew_flags)
{}

static int nfs4_proc_sequence(struct nfs_client *clp, const struct cred *cred)
{}

struct nfs4_reclaim_complete_data {};

static void nfs4_reclaim_complete_prepare(struct rpc_task *task, void *data)
{}

static int nfs41_reclaim_complete_handle_errors(struct rpc_task *task, struct nfs_client *clp)
{}

static void nfs4_reclaim_complete_done(struct rpc_task *task, void *data)
{}

static void nfs4_free_reclaim_complete_data(void *data)
{}

static const struct rpc_call_ops nfs4_reclaim_complete_call_ops =;

/*
 * Issue a global reclaim complete.
 */
static int nfs41_proc_reclaim_complete(struct nfs_client *clp,
		const struct cred *cred)
{}

static void
nfs4_layoutget_prepare(struct rpc_task *task, void *calldata)
{}

static void nfs4_layoutget_done(struct rpc_task *task, void *calldata)
{}

static int
nfs4_layoutget_handle_exception(struct rpc_task *task,
		struct nfs4_layoutget *lgp, struct nfs4_exception *exception)
{}

size_t max_response_pages(struct nfs_server *server)
{}

static void nfs4_layoutget_release(void *calldata)
{}

static const struct rpc_call_ops nfs4_layoutget_call_ops =;

struct pnfs_layout_segment *
nfs4_proc_layoutget(struct nfs4_layoutget *lgp,
		    struct nfs4_exception *exception)
{}

static void
nfs4_layoutreturn_prepare(struct rpc_task *task, void *calldata)
{}

static void nfs4_layoutreturn_done(struct rpc_task *task, void *calldata)
{}

static void nfs4_layoutreturn_release(void *calldata)
{}

static const struct rpc_call_ops nfs4_layoutreturn_call_ops =;

int nfs4_proc_layoutreturn(struct nfs4_layoutreturn *lrp, unsigned int flags)
{}

static int
_nfs4_proc_getdeviceinfo(struct nfs_server *server,
		struct pnfs_device *pdev,
		const struct cred *cred)
{}

int nfs4_proc_getdeviceinfo(struct nfs_server *server,
		struct pnfs_device *pdev,
		const struct cred *cred)
{}
EXPORT_SYMBOL_GPL();

static void nfs4_layoutcommit_prepare(struct rpc_task *task, void *calldata)
{}

static void
nfs4_layoutcommit_done(struct rpc_task *task, void *calldata)
{}

static void nfs4_layoutcommit_release(void *calldata)
{}

static const struct rpc_call_ops nfs4_layoutcommit_ops =;

int
nfs4_proc_layoutcommit(struct nfs4_layoutcommit_data *data, bool sync)
{}

/*
 * Use the state managment nfs_client cl_rpcclient, which uses krb5i (if
 * possible) as per RFC3530bis and RFC5661 Security Considerations sections
 */
static int
_nfs41_proc_secinfo_no_name(struct nfs_server *server, struct nfs_fh *fhandle,
		    struct nfs_fsinfo *info,
		    struct nfs4_secinfo_flavors *flavors, bool use_integrity)
{}

static int
nfs41_proc_secinfo_no_name(struct nfs_server *server, struct nfs_fh *fhandle,
			   struct nfs_fsinfo *info, struct nfs4_secinfo_flavors *flavors)
{}

static int
nfs41_find_root_sec(struct nfs_server *server, struct nfs_fh *fhandle,
		    struct nfs_fsinfo *info)
{}

static int _nfs41_test_stateid(struct nfs_server *server,
			       const nfs4_stateid *stateid,
			       const struct cred *cred)
{}

static void nfs4_handle_delay_or_session_error(struct nfs_server *server,
		int err, struct nfs4_exception *exception)
{}

/**
 * nfs41_test_stateid - perform a TEST_STATEID operation
 *
 * @server: server / transport on which to perform the operation
 * @stateid: state ID to test
 * @cred: credential
 *
 * Returns NFS_OK if the server recognizes that "stateid" is valid.
 * Otherwise a negative NFS4ERR value is returned if the operation
 * failed or the state ID is not currently valid.
 */
static int nfs41_test_stateid(struct nfs_server *server,
			      const nfs4_stateid *stateid,
			      const struct cred *cred)
{}

struct nfs_free_stateid_data {};

static void nfs41_free_stateid_prepare(struct rpc_task *task, void *calldata)
{}

static void nfs41_free_stateid_done(struct rpc_task *task, void *calldata)
{}

static void nfs41_free_stateid_release(void *calldata)
{}

static const struct rpc_call_ops nfs41_free_stateid_ops =;

/**
 * nfs41_free_stateid - perform a FREE_STATEID operation
 *
 * @server: server / transport on which to perform the operation
 * @stateid: state ID to release
 * @cred: credential
 * @privileged: set to true if this call needs to be privileged
 *
 * Note: this function is always asynchronous.
 */
static int nfs41_free_stateid(struct nfs_server *server,
		const nfs4_stateid *stateid,
		const struct cred *cred,
		bool privileged)
{}

static void
nfs41_free_lock_state(struct nfs_server *server, struct nfs4_lock_state *lsp)
{}

static bool nfs41_match_stateid(const nfs4_stateid *s1,
		const nfs4_stateid *s2)
{}

#endif /* CONFIG_NFS_V4_1 */

static bool nfs4_match_stateid(const nfs4_stateid *s1,
		const nfs4_stateid *s2)
{}


static const struct nfs4_state_recovery_ops nfs40_reboot_recovery_ops =;

#if defined(CONFIG_NFS_V4_1)
static const struct nfs4_state_recovery_ops nfs41_reboot_recovery_ops =;
#endif /* CONFIG_NFS_V4_1 */

static const struct nfs4_state_recovery_ops nfs40_nograce_recovery_ops =;

#if defined(CONFIG_NFS_V4_1)
static const struct nfs4_state_recovery_ops nfs41_nograce_recovery_ops =;
#endif /* CONFIG_NFS_V4_1 */

static const struct nfs4_state_maintenance_ops nfs40_state_renewal_ops =;

#if defined(CONFIG_NFS_V4_1)
static const struct nfs4_state_maintenance_ops nfs41_state_renewal_ops =;
#endif

static const struct nfs4_mig_recovery_ops nfs40_mig_recovery_ops =;

#if defined(CONFIG_NFS_V4_1)
static const struct nfs4_mig_recovery_ops nfs41_mig_recovery_ops =;
#endif	/* CONFIG_NFS_V4_1 */

static const struct nfs4_minor_version_ops nfs_v4_0_minor_ops =;

#if defined(CONFIG_NFS_V4_1)
static struct nfs_seqid *
nfs_alloc_no_seqid(struct nfs_seqid_counter *arg1, gfp_t arg2)
{}

static const struct nfs4_minor_version_ops nfs_v4_1_minor_ops =;
#endif

#if defined(CONFIG_NFS_V4_2)
static const struct nfs4_minor_version_ops nfs_v4_2_minor_ops =;
#endif

const struct nfs4_minor_version_ops *nfs_v4_minor_ops[] =;

static ssize_t nfs4_listxattr(struct dentry *dentry, char *list, size_t size)
{}

static void nfs4_enable_swap(struct inode *inode)
{}

static void nfs4_disable_swap(struct inode *inode)
{}

static const struct inode_operations nfs4_dir_inode_operations =;

static const struct inode_operations nfs4_file_inode_operations =;

const struct nfs_rpc_ops nfs_v4_clientops =;

static const struct xattr_handler nfs4_xattr_nfs4_acl_handler =;

#if defined(CONFIG_NFS_V4_1)
static const struct xattr_handler nfs4_xattr_nfs4_dacl_handler =;

static const struct xattr_handler nfs4_xattr_nfs4_sacl_handler =;
#endif

#ifdef CONFIG_NFS_V4_2
static const struct xattr_handler nfs4_xattr_nfs4_user_handler =;
#endif

const struct xattr_handler * const nfs4_xattr_handlers[] =;