#include <linux/module.h>
#include <linux/init.h>
#include <linux/sysctl.h>
#include <linux/moduleparam.h>
#include <linux/sched/signal.h>
#include <linux/errno.h>
#include <linux/in.h>
#include <linux/uio.h>
#include <linux/smp.h>
#include <linux/mutex.h>
#include <linux/freezer.h>
#include <linux/inetdevice.h>
#include <linux/sunrpc/types.h>
#include <linux/sunrpc/stats.h>
#include <linux/sunrpc/clnt.h>
#include <linux/sunrpc/svc.h>
#include <linux/sunrpc/svcsock.h>
#include <linux/sunrpc/svc_xprt.h>
#include <net/ip.h>
#include <net/addrconf.h>
#include <net/ipv6.h>
#include <linux/lockd/lockd.h>
#include <linux/nfs.h>
#include "netns.h"
#include "procfs.h"
#define NLMDBG_FACILITY …
#define LOCKD_BUFSIZE …
static struct svc_program nlmsvc_program;
const struct nlmsvc_binding *nlmsvc_ops;
EXPORT_SYMBOL_GPL(…);
static DEFINE_MUTEX(nlmsvc_mutex);
static unsigned int nlmsvc_users;
static struct svc_serv *nlmsvc_serv;
unsigned long nlmsvc_timeout;
static void nlmsvc_request_retry(struct timer_list *tl)
{ … }
DEFINE_TIMER(nlmsvc_retry, nlmsvc_request_retry);
unsigned int lockd_net_id;
static unsigned long nlm_grace_period;
static unsigned long nlm_timeout = …;
static int nlm_udpport, nlm_tcpport;
static unsigned int nlm_max_connections = …;
static const unsigned long nlm_grace_period_min = …;
static const unsigned long nlm_grace_period_max = …;
static const unsigned long nlm_timeout_min = …;
static const unsigned long nlm_timeout_max = …;
#ifdef CONFIG_SYSCTL
static const int nlm_port_min = …, nlm_port_max = …;
static struct ctl_table_header * nlm_sysctl_table;
#endif
static unsigned long get_lockd_grace_period(void)
{ … }
static void grace_ender(struct work_struct *grace)
{ … }
static void set_grace_period(struct net *net)
{ … }
static int
lockd(void *vrqstp)
{ … }
static int create_lockd_listener(struct svc_serv *serv, const char *name,
struct net *net, const int family,
const unsigned short port,
const struct cred *cred)
{ … }
static int create_lockd_family(struct svc_serv *serv, struct net *net,
const int family, const struct cred *cred)
{ … }
static int make_socks(struct svc_serv *serv, struct net *net,
const struct cred *cred)
{ … }
static int lockd_up_net(struct svc_serv *serv, struct net *net,
const struct cred *cred)
{ … }
static void lockd_down_net(struct svc_serv *serv, struct net *net)
{ … }
static int lockd_inetaddr_event(struct notifier_block *this,
unsigned long event, void *ptr)
{ … }
static struct notifier_block lockd_inetaddr_notifier = …;
#if IS_ENABLED(CONFIG_IPV6)
static int lockd_inet6addr_event(struct notifier_block *this,
unsigned long event, void *ptr)
{ … }
static struct notifier_block lockd_inet6addr_notifier = …;
#endif
static int lockd_get(void)
{ … }
static void lockd_put(void)
{ … }
int lockd_up(struct net *net, const struct cred *cred)
{ … }
EXPORT_SYMBOL_GPL(…);
void
lockd_down(struct net *net)
{ … }
EXPORT_SYMBOL_GPL(…);
#ifdef CONFIG_SYSCTL
static struct ctl_table nlm_sysctls[] = …;
#endif
#define param_set_min_max(name, type, which_strtol, min, max) …
static inline int is_callback(u32 proc)
{ … }
static enum svc_auth_status lockd_authenticate(struct svc_rqst *rqstp)
{ … }
param_set_min_max(…)
param_set_min_max(…)
param_set_min_max(…)
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
module_param_call(…);
module_param_call(…);
module_param_call(…);
module_param_call(…);
module_param(nsm_use_hostnames, bool, 0644);
module_param(nlm_max_connections, uint, 0644);
static int lockd_init_net(struct net *net)
{ … }
static void lockd_exit_net(struct net *net)
{ … }
static struct pernet_operations lockd_net_ops = …;
static int __init init_nlm(void)
{ … }
static void __exit exit_nlm(void)
{ … }
module_init(…) …;
module_exit(exit_nlm);
static int nlmsvc_dispatch(struct svc_rqst *rqstp)
{ … }
static DEFINE_PER_CPU_ALIGNED(unsigned long, nlmsvc_version1_count[17]);
static const struct svc_version nlmsvc_version1 = …;
static DEFINE_PER_CPU_ALIGNED(unsigned long,
nlmsvc_version3_count[ARRAY_SIZE(nlmsvc_procedures)]);
static const struct svc_version nlmsvc_version3 = …;
#ifdef CONFIG_LOCKD_V4
static DEFINE_PER_CPU_ALIGNED(unsigned long,
nlmsvc_version4_count[ARRAY_SIZE(nlmsvc_procedures4)]);
static const struct svc_version nlmsvc_version4 = …;
#endif
static const struct svc_version *nlmsvc_version[] = …;
#define NLM_NRVERS …
static struct svc_program nlmsvc_program = …;