#include <linux/sched/signal.h>
#include <linux/freezer.h>
#include <linux/module.h>
#include <linux/fs_struct.h>
#include <linux/swap.h>
#include <linux/siphash.h>
#include <linux/sunrpc/stats.h>
#include <linux/sunrpc/svcsock.h>
#include <linux/sunrpc/svc_xprt.h>
#include <linux/lockd/bind.h>
#include <linux/nfsacl.h>
#include <linux/seq_file.h>
#include <linux/inetdevice.h>
#include <net/addrconf.h>
#include <net/ipv6.h>
#include <net/net_namespace.h>
#include "nfsd.h"
#include "cache.h"
#include "vfs.h"
#include "netns.h"
#include "filecache.h"
#include "trace.h"
#define NFSDDBG_FACILITY …
atomic_t nfsd_th_cnt = …;
extern struct svc_program nfsd_program;
static int nfsd(void *vrqstp);
#if defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL)
static int nfsd_acl_rpcbind_set(struct net *,
const struct svc_program *,
u32, int,
unsigned short,
unsigned short);
static __be32 nfsd_acl_init_request(struct svc_rqst *,
const struct svc_program *,
struct svc_process_info *);
#endif
static int nfsd_rpcbind_set(struct net *,
const struct svc_program *,
u32, int,
unsigned short,
unsigned short);
static __be32 nfsd_init_request(struct svc_rqst *,
const struct svc_program *,
struct svc_process_info *);
DEFINE_MUTEX(…) …;
DEFINE_SPINLOCK(…);
unsigned long nfsd_drc_max_mem;
unsigned long nfsd_drc_mem_used;
#if defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL)
static const struct svc_version *nfsd_acl_version[] = …;
#define NFSD_ACL_MINVERS …
#define NFSD_ACL_NRVERS …
static struct svc_program nfsd_acl_program = …;
#endif
static const struct svc_version *nfsd_version[] = …;
#define NFSD_MINVERS …
#define NFSD_NRVERS …
struct svc_program nfsd_program = …;
bool nfsd_support_version(int vers)
{ … }
static bool *
nfsd_alloc_versions(void)
{ … }
static bool *
nfsd_alloc_minorversions(void)
{ … }
void
nfsd_netns_free_versions(struct nfsd_net *nn)
{ … }
static void
nfsd_netns_init_versions(struct nfsd_net *nn)
{ … }
int nfsd_vers(struct nfsd_net *nn, int vers, enum vers_op change)
{ … }
static void
nfsd_adjust_nfsd_versions4(struct nfsd_net *nn)
{ … }
int nfsd_minorversion(struct nfsd_net *nn, u32 minorversion, enum vers_op change)
{ … }
#define NFSD_MAXSERVS …
int nfsd_nrthreads(struct net *net)
{ … }
static int nfsd_init_socks(struct net *net, const struct cred *cred)
{ … }
static int nfsd_users = …;
static int nfsd_startup_generic(void)
{ … }
static void nfsd_shutdown_generic(void)
{ … }
static bool nfsd_needs_lockd(struct nfsd_net *nn)
{ … }
void nfsd_copy_write_verifier(__be32 verf[2], struct nfsd_net *nn)
{ … }
static void nfsd_reset_write_verifier_locked(struct nfsd_net *nn)
{ … }
void nfsd_reset_write_verifier(struct nfsd_net *nn)
{ … }
static int nfsd_startup_net(struct net *net, const struct cred *cred)
{ … }
static void nfsd_shutdown_net(struct net *net)
{ … }
static DEFINE_SPINLOCK(nfsd_notifier_lock);
static int nfsd_inetaddr_event(struct notifier_block *this, unsigned long event,
void *ptr)
{ … }
static struct notifier_block nfsd_inetaddr_notifier = …;
#if IS_ENABLED(CONFIG_IPV6)
static int nfsd_inet6addr_event(struct notifier_block *this,
unsigned long event, void *ptr)
{ … }
static struct notifier_block nfsd_inet6addr_notifier = …;
#endif
static atomic_t nfsd_notifier_refcount = …;
void nfsd_destroy_serv(struct net *net)
{ … }
void nfsd_reset_versions(struct nfsd_net *nn)
{ … }
static void set_max_drc(void)
{ … }
static int nfsd_get_default_max_blksize(void)
{ … }
void nfsd_shutdown_threads(struct net *net)
{ … }
bool i_am_nfsd(void)
{ … }
int nfsd_create_serv(struct net *net)
{ … }
int nfsd_nrpools(struct net *net)
{ … }
int nfsd_get_nrthreads(int n, int *nthreads, struct net *net)
{ … }
int nfsd_set_nrthreads(int n, int *nthreads, struct net *net)
{ … }
int
nfsd_svc(int n, int *nthreads, struct net *net, const struct cred *cred, const char *scope)
{ … }
#if defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL)
static bool
nfsd_support_acl_version(int vers)
{ … }
static int
nfsd_acl_rpcbind_set(struct net *net, const struct svc_program *progp,
u32 version, int family, unsigned short proto,
unsigned short port)
{ … }
static __be32
nfsd_acl_init_request(struct svc_rqst *rqstp,
const struct svc_program *progp,
struct svc_process_info *ret)
{ … }
#endif
static int
nfsd_rpcbind_set(struct net *net, const struct svc_program *progp,
u32 version, int family, unsigned short proto,
unsigned short port)
{ … }
static __be32
nfsd_init_request(struct svc_rqst *rqstp,
const struct svc_program *progp,
struct svc_process_info *ret)
{ … }
static int
nfsd(void *vrqstp)
{ … }
int nfsd_dispatch(struct svc_rqst *rqstp)
{ … }
bool nfssvc_decode_voidarg(struct svc_rqst *rqstp, struct xdr_stream *xdr)
{ … }
bool nfssvc_encode_voidres(struct svc_rqst *rqstp, struct xdr_stream *xdr)
{ … }
int nfsd_pool_stats_open(struct inode *inode, struct file *file)
{ … }