Commit 5e092be7 authored by Chuck Lever's avatar Chuck Lever

NFSD: Distinguish per-net namespace initialization

I find the naming of nfsd_init_net() and nfsd_startup_net() to be
confusingly similar. Rename the namespace initialization and tear-
down ops and add comments to distinguish their separate purposes.
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
parent ed9ab734
...@@ -1494,7 +1494,17 @@ static int create_proc_exports_entry(void) ...@@ -1494,7 +1494,17 @@ static int create_proc_exports_entry(void)
unsigned int nfsd_net_id; unsigned int nfsd_net_id;
static __net_init int nfsd_init_net(struct net *net) /**
* nfsd_net_init - Prepare the nfsd_net portion of a new net namespace
* @net: a freshly-created network namespace
*
* This information stays around as long as the network namespace is
* alive whether or not there is an NFSD instance running in the
* namespace.
*
* Returns zero on success, or a negative errno otherwise.
*/
static __net_init int nfsd_net_init(struct net *net)
{ {
int retval; int retval;
struct nfsd_net *nn = net_generic(net, nfsd_net_id); struct nfsd_net *nn = net_generic(net, nfsd_net_id);
...@@ -1524,7 +1534,12 @@ static __net_init int nfsd_init_net(struct net *net) ...@@ -1524,7 +1534,12 @@ static __net_init int nfsd_init_net(struct net *net)
return retval; return retval;
} }
static __net_exit void nfsd_exit_net(struct net *net) /**
* nfsd_net_exit - Release the nfsd_net portion of a net namespace
* @net: a network namespace that is about to be destroyed
*
*/
static __net_exit void nfsd_net_exit(struct net *net)
{ {
struct nfsd_net *nn = net_generic(net, nfsd_net_id); struct nfsd_net *nn = net_generic(net, nfsd_net_id);
...@@ -1535,8 +1550,8 @@ static __net_exit void nfsd_exit_net(struct net *net) ...@@ -1535,8 +1550,8 @@ static __net_exit void nfsd_exit_net(struct net *net)
} }
static struct pernet_operations nfsd_net_ops = { static struct pernet_operations nfsd_net_ops = {
.init = nfsd_init_net, .init = nfsd_net_init,
.exit = nfsd_exit_net, .exit = nfsd_net_exit,
.id = &nfsd_net_id, .id = &nfsd_net_id,
.size = sizeof(struct nfsd_net), .size = sizeof(struct nfsd_net),
}; };
......
...@@ -402,6 +402,11 @@ void nfsd_reset_write_verifier(struct nfsd_net *nn) ...@@ -402,6 +402,11 @@ void nfsd_reset_write_verifier(struct nfsd_net *nn)
write_sequnlock(&nn->writeverf_lock); write_sequnlock(&nn->writeverf_lock);
} }
/*
* Crank up a set of per-namespace resources for a new NFSD instance,
* including lockd, a duplicate reply cache, an open file cache
* instance, and a cache of NFSv4 state objects.
*/
static int nfsd_startup_net(struct net *net, const struct cred *cred) static int nfsd_startup_net(struct net *net, const struct cred *cred)
{ {
struct nfsd_net *nn = net_generic(net, nfsd_net_id); struct nfsd_net *nn = net_generic(net, nfsd_net_id);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment