Skip to content

Commit

Permalink
SUNRPC: Remove svo_shutdown method
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: NeilBrown <[email protected]>
  • Loading branch information
chucklever committed Feb 28, 2022
1 parent c0219c4 commit 87cdd86
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 10 deletions.
5 changes: 2 additions & 3 deletions fs/lockd/svc.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ static int make_socks(struct svc_serv *serv, struct net *net,
printk(KERN_WARNING
"lockd_up: makesock failed, error=%d\n", err);
svc_shutdown_net(serv, net);
svc_rpcb_cleanup(serv, net);
return err;
}

Expand Down Expand Up @@ -287,8 +288,7 @@ static void lockd_down_net(struct svc_serv *serv, struct net *net)
cancel_delayed_work_sync(&ln->grace_period_end);
locks_end_grace(&ln->lockd_manager);
svc_shutdown_net(serv, net);
dprintk("%s: per-net data destroyed; net=%x\n",
__func__, net->ns.inum);
svc_rpcb_cleanup(serv, net);
}
} else {
pr_err("%s: no users! net=%x\n",
Expand Down Expand Up @@ -351,7 +351,6 @@ static struct notifier_block lockd_inet6addr_notifier = {
#endif

static const struct svc_serv_ops lockd_sv_ops = {
.svo_shutdown = svc_rpcb_cleanup,
.svo_function = lockd,
.svo_module = THIS_MODULE,
};
Expand Down
2 changes: 1 addition & 1 deletion fs/nfsd/nfssvc.c
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,6 @@ static int nfsd_get_default_max_blksize(void)
}

static const struct svc_serv_ops nfsd_thread_sv_ops = {
.svo_shutdown = nfsd_last_thread,
.svo_function = nfsd,
.svo_module = THIS_MODULE,
};
Expand Down Expand Up @@ -724,6 +723,7 @@ void nfsd_put(struct net *net)

if (kref_put(&nn->nfsd_serv->sv_refcnt, nfsd_noop)) {
svc_shutdown_net(nn->nfsd_serv, net);
nfsd_last_thread(nn->nfsd_serv, net);
svc_destroy(&nn->nfsd_serv->sv_refcnt);
spin_lock(&nfsd_notifier_lock);
nn->nfsd_serv = NULL;
Expand Down
3 changes: 0 additions & 3 deletions include/linux/sunrpc/svc.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@ struct svc_pool {
struct svc_serv;

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 */
int (*svo_function)(void *);

Expand Down
3 changes: 0 additions & 3 deletions net/sunrpc/svc.c
Original file line number Diff line number Diff line change
Expand Up @@ -539,9 +539,6 @@ EXPORT_SYMBOL_GPL(svc_create_pooled);
void svc_shutdown_net(struct svc_serv *serv, struct net *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);

Expand Down

0 comments on commit 87cdd86

Please sign in to comment.