Skip to content

Commit 87cdd86

Browse files
committed
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 <[email protected]> Reviewed-by: NeilBrown <[email protected]>
1 parent c0219c4 commit 87cdd86

File tree

4 files changed

+3
-10
lines changed

4 files changed

+3
-10
lines changed

fs/lockd/svc.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ static int make_socks(struct svc_serv *serv, struct net *net,
249249
printk(KERN_WARNING
250250
"lockd_up: makesock failed, error=%d\n", err);
251251
svc_shutdown_net(serv, net);
252+
svc_rpcb_cleanup(serv, net);
252253
return err;
253254
}
254255

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

353353
static const struct svc_serv_ops lockd_sv_ops = {
354-
.svo_shutdown = svc_rpcb_cleanup,
355354
.svo_function = lockd,
356355
.svo_module = THIS_MODULE,
357356
};

fs/nfsd/nfssvc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,6 @@ static int nfsd_get_default_max_blksize(void)
613613
}
614614

615615
static const struct svc_serv_ops nfsd_thread_sv_ops = {
616-
.svo_shutdown = nfsd_last_thread,
617616
.svo_function = nfsd,
618617
.svo_module = THIS_MODULE,
619618
};
@@ -724,6 +723,7 @@ void nfsd_put(struct net *net)
724723

725724
if (kref_put(&nn->nfsd_serv->sv_refcnt, nfsd_noop)) {
726725
svc_shutdown_net(nn->nfsd_serv, net);
726+
nfsd_last_thread(nn->nfsd_serv, net);
727727
svc_destroy(&nn->nfsd_serv->sv_refcnt);
728728
spin_lock(&nfsd_notifier_lock);
729729
nn->nfsd_serv = NULL;

include/linux/sunrpc/svc.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,6 @@ struct svc_pool {
5555
struct svc_serv;
5656

5757
struct svc_serv_ops {
58-
/* Callback to use when last thread exits. */
59-
void (*svo_shutdown)(struct svc_serv *, struct net *);
60-
6158
/* function for service threads to run */
6259
int (*svo_function)(void *);
6360

net/sunrpc/svc.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -539,9 +539,6 @@ EXPORT_SYMBOL_GPL(svc_create_pooled);
539539
void svc_shutdown_net(struct svc_serv *serv, struct net *net)
540540
{
541541
svc_close_net(serv, net);
542-
543-
if (serv->sv_ops->svo_shutdown)
544-
serv->sv_ops->svo_shutdown(serv, net);
545542
}
546543
EXPORT_SYMBOL_GPL(svc_shutdown_net);
547544

0 commit comments

Comments
 (0)