SUNRPC: Remove svo_shutdown method

Clean up. Neil observed that "any code that calls svc_shutdown_net()
knows what the shutdown function should be, and so can call it
directly."

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Reviewed-by: NeilBrown <neilb@suse.de>
This commit is contained in:
Chuck Lever 2022-01-25 13:49:29 -05:00
parent c0219c4997
commit 87cdd8641c
4 changed files with 3 additions and 10 deletions

View File

@ -249,6 +249,7 @@ out_err:
printk(KERN_WARNING printk(KERN_WARNING
"lockd_up: makesock failed, error=%d\n", err); "lockd_up: makesock failed, error=%d\n", err);
svc_shutdown_net(serv, net); svc_shutdown_net(serv, net);
svc_rpcb_cleanup(serv, net);
return err; return err;
} }
@ -287,8 +288,7 @@ static void lockd_down_net(struct svc_serv *serv, struct net *net)
cancel_delayed_work_sync(&ln->grace_period_end); cancel_delayed_work_sync(&ln->grace_period_end);
locks_end_grace(&ln->lockd_manager); locks_end_grace(&ln->lockd_manager);
svc_shutdown_net(serv, net); svc_shutdown_net(serv, net);
dprintk("%s: per-net data destroyed; net=%x\n", svc_rpcb_cleanup(serv, net);
__func__, net->ns.inum);
} }
} else { } else {
pr_err("%s: no users! net=%x\n", pr_err("%s: no users! net=%x\n",
@ -351,7 +351,6 @@ static struct notifier_block lockd_inet6addr_notifier = {
#endif #endif
static const struct svc_serv_ops lockd_sv_ops = { static const struct svc_serv_ops lockd_sv_ops = {
.svo_shutdown = svc_rpcb_cleanup,
.svo_function = lockd, .svo_function = lockd,
.svo_module = THIS_MODULE, .svo_module = THIS_MODULE,
}; };

View File

@ -613,7 +613,6 @@ static int nfsd_get_default_max_blksize(void)
} }
static const struct svc_serv_ops nfsd_thread_sv_ops = { static const struct svc_serv_ops nfsd_thread_sv_ops = {
.svo_shutdown = nfsd_last_thread,
.svo_function = nfsd, .svo_function = nfsd,
.svo_module = THIS_MODULE, .svo_module = THIS_MODULE,
}; };
@ -724,6 +723,7 @@ void nfsd_put(struct net *net)
if (kref_put(&nn->nfsd_serv->sv_refcnt, nfsd_noop)) { if (kref_put(&nn->nfsd_serv->sv_refcnt, nfsd_noop)) {
svc_shutdown_net(nn->nfsd_serv, net); svc_shutdown_net(nn->nfsd_serv, net);
nfsd_last_thread(nn->nfsd_serv, net);
svc_destroy(&nn->nfsd_serv->sv_refcnt); svc_destroy(&nn->nfsd_serv->sv_refcnt);
spin_lock(&nfsd_notifier_lock); spin_lock(&nfsd_notifier_lock);
nn->nfsd_serv = NULL; nn->nfsd_serv = NULL;

View File

@ -55,9 +55,6 @@ struct svc_pool {
struct svc_serv; struct svc_serv;
struct svc_serv_ops { struct svc_serv_ops {
/* Callback to use when last thread exits. */
void (*svo_shutdown)(struct svc_serv *, struct net *);
/* function for service threads to run */ /* function for service threads to run */
int (*svo_function)(void *); int (*svo_function)(void *);

View File

@ -539,9 +539,6 @@ EXPORT_SYMBOL_GPL(svc_create_pooled);
void svc_shutdown_net(struct svc_serv *serv, struct net *net) void svc_shutdown_net(struct svc_serv *serv, struct net *net)
{ {
svc_close_net(serv, net); svc_close_net(serv, net);
if (serv->sv_ops->svo_shutdown)
serv->sv_ops->svo_shutdown(serv, net);
} }
EXPORT_SYMBOL_GPL(svc_shutdown_net); EXPORT_SYMBOL_GPL(svc_shutdown_net);