#include <linux/completion.h>
#include <linux/kthread.h>
#include <linux/module.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
#include <linux/iversion.h>
#include <linux/nfs4.h>
#include <linux/nfs_fs.h>
#include <linux/nfs_xdr.h>
#include "nfs4_fs.h"
#include "nfs4session.h"
#include "delegation.h"
#include "internal.h"
#include "nfs4trace.h"
#define NFS_DEFAULT_DELEGATION_WATERMARK …
static atomic_long_t nfs_active_delegations;
static unsigned nfs_delegation_watermark = …;
static void __nfs_free_delegation(struct nfs_delegation *delegation)
{ … }
static void nfs_mark_delegation_revoked(struct nfs_delegation *delegation)
{ … }
static struct nfs_delegation *nfs_get_delegation(struct nfs_delegation *delegation)
{ … }
static void nfs_put_delegation(struct nfs_delegation *delegation)
{ … }
static void nfs_free_delegation(struct nfs_delegation *delegation)
{ … }
void nfs_mark_delegation_referenced(struct nfs_delegation *delegation)
{ … }
static void nfs_mark_return_delegation(struct nfs_server *server,
struct nfs_delegation *delegation)
{ … }
static bool nfs4_is_valid_delegation(const struct nfs_delegation *delegation,
fmode_t type)
{ … }
struct nfs_delegation *nfs4_get_valid_delegation(const struct inode *inode)
{ … }
static int nfs4_do_check_delegation(struct inode *inode, fmode_t type,
int flags, bool mark)
{ … }
int nfs4_have_delegation(struct inode *inode, fmode_t type, int flags)
{ … }
int nfs4_check_delegation(struct inode *inode, fmode_t type)
{ … }
static int nfs_delegation_claim_locks(struct nfs4_state *state, const nfs4_stateid *stateid)
{ … }
static int nfs_delegation_claim_opens(struct inode *inode,
const nfs4_stateid *stateid, fmode_t type)
{ … }
void nfs_inode_reclaim_delegation(struct inode *inode, const struct cred *cred,
fmode_t type, const nfs4_stateid *stateid,
unsigned long pagemod_limit, u32 deleg_type)
{ … }
static int nfs_do_return_delegation(struct inode *inode,
struct nfs_delegation *delegation,
int issync)
{ … }
static struct inode *nfs_delegation_grab_inode(struct nfs_delegation *delegation)
{ … }
static struct nfs_delegation *
nfs_start_delegation_return_locked(struct nfs_inode *nfsi)
{ … }
static struct nfs_delegation *
nfs_start_delegation_return(struct nfs_inode *nfsi)
{ … }
static void nfs_abort_delegation_return(struct nfs_delegation *delegation,
struct nfs_client *clp, int err)
{ … }
static struct nfs_delegation *
nfs_detach_delegation_locked(struct nfs_inode *nfsi,
struct nfs_delegation *delegation,
struct nfs_client *clp)
{ … }
static struct nfs_delegation *nfs_detach_delegation(struct nfs_inode *nfsi,
struct nfs_delegation *delegation,
struct nfs_server *server)
{ … }
static struct nfs_delegation *
nfs_inode_detach_delegation(struct inode *inode)
{ … }
static void
nfs_update_delegation_cred(struct nfs_delegation *delegation,
const struct cred *cred)
{ … }
static void
nfs_update_inplace_delegation(struct nfs_delegation *delegation,
const struct nfs_delegation *update)
{ … }
int nfs_inode_set_delegation(struct inode *inode, const struct cred *cred,
fmode_t type, const nfs4_stateid *stateid,
unsigned long pagemod_limit, u32 deleg_type)
{ … }
static int nfs_end_delegation_return(struct inode *inode, struct nfs_delegation *delegation, int issync)
{ … }
static bool nfs_delegation_need_return(struct nfs_delegation *delegation)
{ … }
static int nfs_server_return_marked_delegations(struct nfs_server *server,
void __always_unused *data)
{ … }
static bool nfs_server_clear_delayed_delegations(struct nfs_server *server)
{ … }
static bool nfs_client_clear_delayed_delegations(struct nfs_client *clp)
{ … }
int nfs_client_return_marked_delegations(struct nfs_client *clp)
{ … }
void nfs_inode_evict_delegation(struct inode *inode)
{ … }
int nfs4_inode_return_delegation(struct inode *inode)
{ … }
void nfs4_inode_return_delegation_on_close(struct inode *inode)
{ … }
int nfs4_inode_make_writeable(struct inode *inode)
{ … }
static void nfs_mark_return_if_closed_delegation(struct nfs_server *server,
struct nfs_delegation *delegation)
{ … }
static bool nfs_server_mark_return_all_delegations(struct nfs_server *server)
{ … }
static void nfs_client_mark_return_all_delegations(struct nfs_client *clp)
{ … }
static void nfs_delegation_run_state_manager(struct nfs_client *clp)
{ … }
void nfs_expire_all_delegations(struct nfs_client *clp)
{ … }
void nfs_server_return_all_delegations(struct nfs_server *server)
{ … }
static void nfs_mark_return_unused_delegation_types(struct nfs_server *server,
fmode_t flags)
{ … }
static void nfs_client_mark_return_unused_delegation_types(struct nfs_client *clp,
fmode_t flags)
{ … }
static void nfs_revoke_delegation(struct inode *inode,
const nfs4_stateid *stateid)
{ … }
void nfs_remove_bad_delegation(struct inode *inode,
const nfs4_stateid *stateid)
{ … }
EXPORT_SYMBOL_GPL(…);
void nfs_delegation_mark_returned(struct inode *inode,
const nfs4_stateid *stateid)
{ … }
void nfs_expire_unused_delegation_types(struct nfs_client *clp, fmode_t flags)
{ … }
static void nfs_mark_return_unreferenced_delegations(struct nfs_server *server)
{ … }
void nfs_expire_unreferenced_delegations(struct nfs_client *clp)
{ … }
int nfs_async_inode_return_delegation(struct inode *inode,
const nfs4_stateid *stateid)
{ … }
static struct inode *
nfs_delegation_find_inode_server(struct nfs_server *server,
const struct nfs_fh *fhandle)
{ … }
struct inode *nfs_delegation_find_inode(struct nfs_client *clp,
const struct nfs_fh *fhandle)
{ … }
static void nfs_delegation_mark_reclaim_server(struct nfs_server *server)
{ … }
void nfs_delegation_mark_reclaim(struct nfs_client *clp)
{ … }
static int nfs_server_reap_unclaimed_delegations(struct nfs_server *server,
void __always_unused *data)
{ … }
void nfs_delegation_reap_unclaimed(struct nfs_client *clp)
{ … }
static inline bool nfs4_server_rebooted(const struct nfs_client *clp)
{ … }
static void nfs_mark_test_expired_delegation(struct nfs_server *server,
struct nfs_delegation *delegation)
{ … }
static void nfs_inode_mark_test_expired_delegation(struct nfs_server *server,
struct inode *inode)
{ … }
static void nfs_delegation_mark_test_expired_server(struct nfs_server *server)
{ … }
void nfs_mark_test_expired_all_delegations(struct nfs_client *clp)
{ … }
void nfs_test_expired_all_delegations(struct nfs_client *clp)
{ … }
static void
nfs_delegation_test_free_expired(struct inode *inode,
nfs4_stateid *stateid,
const struct cred *cred)
{ … }
static int nfs_server_reap_expired_delegations(struct nfs_server *server,
void __always_unused *data)
{ … }
void nfs_reap_expired_delegations(struct nfs_client *clp)
{ … }
void nfs_inode_find_delegation_state_and_recover(struct inode *inode,
const nfs4_stateid *stateid)
{ … }
int nfs_delegations_present(struct nfs_client *clp)
{ … }
bool nfs4_refresh_delegation_stateid(nfs4_stateid *dst, struct inode *inode)
{ … }
bool nfs4_copy_delegation_stateid(struct inode *inode, fmode_t flags,
nfs4_stateid *dst, const struct cred **cred)
{ … }
bool nfs4_delegation_flush_on_close(const struct inode *inode)
{ … }
module_param_named(delegation_watermark, nfs_delegation_watermark, uint, 0644);