Skip to content

Commit 17419ae

Browse files
neilbrownchucklever
authored andcommitted
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: NeilBrown <[email protected]> Reviewed-by: Jeff Layton <[email protected]> Signed-off-by: Chuck Lever <[email protected]>
1 parent 1e3577a commit 17419ae

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

fs/nfsd/nfsctl.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,8 @@ static ssize_t __write_ports_addfd(char *buf, struct net *net, const struct cred
712712
err = svc_addsock(serv, net, fd, buf, SIMPLE_TRANSACTION_LIMIT, cred);
713713

714714
if (!serv->sv_nrthreads && list_empty(&nn->nfsd_serv->sv_permsocks))
715-
nfsd_last_thread(net);
715+
nfsd_destroy_serv(net);
716+
716717
return err;
717718
}
718719

@@ -759,7 +760,7 @@ static ssize_t __write_ports_addxprt(char *buf, struct net *net, const struct cr
759760
}
760761
out_err:
761762
if (!serv->sv_nrthreads && list_empty(&nn->nfsd_serv->sv_permsocks))
762-
nfsd_last_thread(net);
763+
nfsd_destroy_serv(net);
763764

764765
return err;
765766
}

fs/nfsd/nfsd.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ int nfsd_vers(struct nfsd_net *nn, int vers, enum vers_op change);
148148
int nfsd_minorversion(struct nfsd_net *nn, u32 minorversion, enum vers_op change);
149149
void nfsd_reset_versions(struct nfsd_net *nn);
150150
int nfsd_create_serv(struct net *net);
151-
void nfsd_last_thread(struct net *net);
151+
void nfsd_destroy_serv(struct net *net);
152152

153153
extern int nfsd_max_blksize;
154154

fs/nfsd/nfssvc.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,11 @@ static struct notifier_block nfsd_inet6addr_notifier = {
532532
/* Only used under nfsd_mutex, so this atomic may be overkill: */
533533
static atomic_t nfsd_notifier_refcount = ATOMIC_INIT(0);
534534

535-
void nfsd_last_thread(struct net *net)
535+
/**
536+
* nfsd_destroy_serv - tear down NFSD's svc_serv for a namespace
537+
* @net: network namespace the NFS service is associated with
538+
*/
539+
void nfsd_destroy_serv(struct net *net)
536540
{
537541
struct nfsd_net *nn = net_generic(net, nfsd_net_id);
538542
struct svc_serv *serv = nn->nfsd_serv;
@@ -554,7 +558,7 @@ void nfsd_last_thread(struct net *net)
554558
/*
555559
* write_ports can create the server without actually starting
556560
* any threads--if we get shut down before any threads are
557-
* started, then nfsd_last_thread will be run before any of this
561+
* started, then nfsd_destroy_serv will be run before any of this
558562
* other initialization has been done except the rpcb information.
559563
*/
560564
svc_rpcb_cleanup(serv, net);
@@ -640,7 +644,7 @@ void nfsd_shutdown_threads(struct net *net)
640644

641645
/* Kill outstanding nfsd threads */
642646
svc_set_num_threads(serv, NULL, 0);
643-
nfsd_last_thread(net);
647+
nfsd_destroy_serv(net);
644648
mutex_unlock(&nfsd_mutex);
645649
}
646650

@@ -802,7 +806,7 @@ nfsd_svc(int nrservs, struct net *net, const struct cred *cred)
802806
error = serv->sv_nrthreads;
803807
out_put:
804808
if (serv->sv_nrthreads == 0)
805-
nfsd_last_thread(net);
809+
nfsd_destroy_serv(net);
806810
out:
807811
mutex_unlock(&nfsd_mutex);
808812
return error;

0 commit comments

Comments
 (0)