Commit 17419aef authored by NeilBrown's avatar NeilBrown Committed by Chuck Lever

nfsd: rename nfsd_last_thread() to nfsd_destroy_serv()

As this function now destroys the svc_serv, this is a better name.
Signed-off-by: default avatarNeilBrown <neilb@suse.de>
Reviewed-by: default avatarJeff Layton <jlayton@kernel.org>
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
parent 1e3577a4
...@@ -712,7 +712,8 @@ static ssize_t __write_ports_addfd(char *buf, struct net *net, const struct cred ...@@ -712,7 +712,8 @@ static ssize_t __write_ports_addfd(char *buf, struct net *net, const struct cred
err = svc_addsock(serv, net, fd, buf, SIMPLE_TRANSACTION_LIMIT, cred); err = svc_addsock(serv, net, fd, buf, SIMPLE_TRANSACTION_LIMIT, cred);
if (!serv->sv_nrthreads && list_empty(&nn->nfsd_serv->sv_permsocks)) if (!serv->sv_nrthreads && list_empty(&nn->nfsd_serv->sv_permsocks))
nfsd_last_thread(net); nfsd_destroy_serv(net);
return err; return err;
} }
...@@ -759,7 +760,7 @@ static ssize_t __write_ports_addxprt(char *buf, struct net *net, const struct cr ...@@ -759,7 +760,7 @@ static ssize_t __write_ports_addxprt(char *buf, struct net *net, const struct cr
} }
out_err: out_err:
if (!serv->sv_nrthreads && list_empty(&nn->nfsd_serv->sv_permsocks)) if (!serv->sv_nrthreads && list_empty(&nn->nfsd_serv->sv_permsocks))
nfsd_last_thread(net); nfsd_destroy_serv(net);
return err; return err;
} }
......
...@@ -148,7 +148,7 @@ int nfsd_vers(struct nfsd_net *nn, int vers, enum vers_op change); ...@@ -148,7 +148,7 @@ int nfsd_vers(struct nfsd_net *nn, int vers, enum vers_op change);
int nfsd_minorversion(struct nfsd_net *nn, u32 minorversion, enum vers_op change); int nfsd_minorversion(struct nfsd_net *nn, u32 minorversion, enum vers_op change);
void nfsd_reset_versions(struct nfsd_net *nn); void nfsd_reset_versions(struct nfsd_net *nn);
int nfsd_create_serv(struct net *net); int nfsd_create_serv(struct net *net);
void nfsd_last_thread(struct net *net); void nfsd_destroy_serv(struct net *net);
extern int nfsd_max_blksize; extern int nfsd_max_blksize;
......
...@@ -532,7 +532,11 @@ static struct notifier_block nfsd_inet6addr_notifier = { ...@@ -532,7 +532,11 @@ static struct notifier_block nfsd_inet6addr_notifier = {
/* Only used under nfsd_mutex, so this atomic may be overkill: */ /* Only used under nfsd_mutex, so this atomic may be overkill: */
static atomic_t nfsd_notifier_refcount = ATOMIC_INIT(0); static atomic_t nfsd_notifier_refcount = ATOMIC_INIT(0);
void nfsd_last_thread(struct net *net) /**
* nfsd_destroy_serv - tear down NFSD's svc_serv for a namespace
* @net: network namespace the NFS service is associated with
*/
void nfsd_destroy_serv(struct net *net)
{ {
struct nfsd_net *nn = net_generic(net, nfsd_net_id); struct nfsd_net *nn = net_generic(net, nfsd_net_id);
struct svc_serv *serv = nn->nfsd_serv; struct svc_serv *serv = nn->nfsd_serv;
...@@ -554,7 +558,7 @@ void nfsd_last_thread(struct net *net) ...@@ -554,7 +558,7 @@ void nfsd_last_thread(struct net *net)
/* /*
* write_ports can create the server without actually starting * write_ports can create the server without actually starting
* any threads--if we get shut down before any threads are * any threads--if we get shut down before any threads are
* started, then nfsd_last_thread will be run before any of this * started, then nfsd_destroy_serv will be run before any of this
* other initialization has been done except the rpcb information. * other initialization has been done except the rpcb information.
*/ */
svc_rpcb_cleanup(serv, net); svc_rpcb_cleanup(serv, net);
...@@ -640,7 +644,7 @@ void nfsd_shutdown_threads(struct net *net) ...@@ -640,7 +644,7 @@ void nfsd_shutdown_threads(struct net *net)
/* Kill outstanding nfsd threads */ /* Kill outstanding nfsd threads */
svc_set_num_threads(serv, NULL, 0); svc_set_num_threads(serv, NULL, 0);
nfsd_last_thread(net); nfsd_destroy_serv(net);
mutex_unlock(&nfsd_mutex); mutex_unlock(&nfsd_mutex);
} }
...@@ -802,7 +806,7 @@ nfsd_svc(int nrservs, struct net *net, const struct cred *cred) ...@@ -802,7 +806,7 @@ nfsd_svc(int nrservs, struct net *net, const struct cred *cred)
error = serv->sv_nrthreads; error = serv->sv_nrthreads;
out_put: out_put:
if (serv->sv_nrthreads == 0) if (serv->sv_nrthreads == 0)
nfsd_last_thread(net); nfsd_destroy_serv(net);
out: out:
mutex_unlock(&nfsd_mutex); mutex_unlock(&nfsd_mutex);
return error; return error;
......
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