Skip to content

Commit c7d7ec8

Browse files
committed
SUNRPC: Remove svc_shutdown_net()
Clean up: svc_shutdown_net() now does nothing but call svc_close_net(). Replace all external call sites. svc_close_net() is renamed to be the inverse of svc_xprt_create(). Signed-off-by: Chuck Lever <[email protected]>
1 parent 4355d76 commit c7d7ec8

File tree

7 files changed

+12
-13
lines changed

7 files changed

+12
-13
lines changed

fs/lockd/svc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ static int make_socks(struct svc_serv *serv, struct net *net,
248248
if (warned++ == 0)
249249
printk(KERN_WARNING
250250
"lockd_up: makesock failed, error=%d\n", err);
251-
svc_shutdown_net(serv, net);
251+
svc_xprt_destroy_all(serv, net);
252252
svc_rpcb_cleanup(serv, net);
253253
return err;
254254
}
@@ -287,7 +287,7 @@ static void lockd_down_net(struct svc_serv *serv, struct net *net)
287287
nlm_shutdown_hosts_net(net);
288288
cancel_delayed_work_sync(&ln->grace_period_end);
289289
locks_end_grace(&ln->lockd_manager);
290-
svc_shutdown_net(serv, net);
290+
svc_xprt_destroy_all(serv, net);
291291
svc_rpcb_cleanup(serv, net);
292292
}
293293
} else {

fs/nfs/callback.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ static void nfs_callback_down_net(u32 minorversion, struct svc_serv *serv, struc
189189
return;
190190

191191
dprintk("NFS: destroy per-net callback data; net=%x\n", net->ns.inum);
192-
svc_shutdown_net(serv, net);
192+
svc_xprt_destroy_all(serv, net);
193193
}
194194

195195
static int nfs_callback_up_net(int minorversion, struct svc_serv *serv,

fs/nfsd/nfssvc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,7 @@ void nfsd_put(struct net *net)
722722
struct nfsd_net *nn = net_generic(net, nfsd_net_id);
723723

724724
if (kref_put(&nn->nfsd_serv->sv_refcnt, nfsd_noop)) {
725-
svc_shutdown_net(nn->nfsd_serv, net);
725+
svc_xprt_destroy_all(nn->nfsd_serv, net);
726726
nfsd_last_thread(nn->nfsd_serv, net);
727727
svc_destroy(&nn->nfsd_serv->sv_refcnt);
728728
spin_lock(&nfsd_notifier_lock);

include/linux/sunrpc/svc.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,6 @@ struct svc_serv * svc_create_pooled(struct svc_program *, unsigned int,
508508
const struct svc_serv_ops *);
509509
int svc_set_num_threads(struct svc_serv *, struct svc_pool *, int);
510510
int svc_pool_stats_open(struct svc_serv *serv, struct file *file);
511-
void svc_shutdown_net(struct svc_serv *, struct net *);
512511
int svc_process(struct svc_rqst *);
513512
int bc_svc_process(struct svc_serv *, struct rpc_rqst *,
514513
struct svc_rqst *);

include/linux/sunrpc/svc_xprt.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ int svc_xprt_create(struct svc_serv *serv, const char *xprt_name,
131131
struct net *net, const int family,
132132
const unsigned short port, int flags,
133133
const struct cred *cred);
134+
void svc_xprt_destroy_all(struct svc_serv *serv, struct net *net);
134135
void svc_xprt_received(struct svc_xprt *xprt);
135136
void svc_xprt_enqueue(struct svc_xprt *xprt);
136137
void svc_xprt_put(struct svc_xprt *xprt);

net/sunrpc/svc.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -536,12 +536,6 @@ svc_create_pooled(struct svc_program *prog, unsigned int bufsize,
536536
}
537537
EXPORT_SYMBOL_GPL(svc_create_pooled);
538538

539-
void svc_shutdown_net(struct svc_serv *serv, struct net *net)
540-
{
541-
svc_close_net(serv, net);
542-
}
543-
EXPORT_SYMBOL_GPL(svc_shutdown_net);
544-
545539
/*
546540
* Destroy an RPC service. Should be called with appropriate locking to
547541
* protect sv_permsocks and sv_tempsocks.

net/sunrpc/svc_xprt.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1140,7 +1140,11 @@ static void svc_clean_up_xprts(struct svc_serv *serv, struct net *net)
11401140
}
11411141
}
11421142

1143-
/*
1143+
/**
1144+
* svc_xprt_destroy_all - Destroy transports associated with @serv
1145+
* @serv: RPC service to be shut down
1146+
* @net: target network namespace
1147+
*
11441148
* Server threads may still be running (especially in the case where the
11451149
* service is still running in other network namespaces).
11461150
*
@@ -1152,7 +1156,7 @@ static void svc_clean_up_xprts(struct svc_serv *serv, struct net *net)
11521156
* threads, we may need to wait a little while and then check again to
11531157
* see if they're done.
11541158
*/
1155-
void svc_close_net(struct svc_serv *serv, struct net *net)
1159+
void svc_xprt_destroy_all(struct svc_serv *serv, struct net *net)
11561160
{
11571161
int delay = 0;
11581162

@@ -1163,6 +1167,7 @@ void svc_close_net(struct svc_serv *serv, struct net *net)
11631167
msleep(delay++);
11641168
}
11651169
}
1170+
EXPORT_SYMBOL_GPL(svc_xprt_destroy_all);
11661171

11671172
/*
11681173
* Handle defer and revisit of requests

0 commit comments

Comments
 (0)