diff options
author | Stanislav Kinsbursky <skinsbursky@parallels.com> | 2012-05-02 08:08:38 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2012-05-31 20:29:39 -0400 |
commit | 9793f7c88937e7ac07305ab1af1a519225836823 (patch) | |
tree | 48a4283a15cb0d5a427e722075fe546cc8cdcc53 /net/sunrpc/rpcb_clnt.c | |
parent | c52226daf553b21891f39777d78a54ea4e7e8654 (diff) |
SUNRPC: new svc_bind() routine introduced
This new routine is responsible for service registration in a specified
network context.
The idea is to separate service creation from per-net operations.
Note also: since registering service with svc_bind() can fail, the
service will be destroyed and during destruction it will try to
unregister itself from rpcbind. In this case unregistration has to be
skipped.
Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'net/sunrpc/rpcb_clnt.c')
-rw-r--r-- | net/sunrpc/rpcb_clnt.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/net/sunrpc/rpcb_clnt.c b/net/sunrpc/rpcb_clnt.c index 78ac39fd9fe7..4c38b33ab8a8 100644 --- a/net/sunrpc/rpcb_clnt.c +++ b/net/sunrpc/rpcb_clnt.c | |||
@@ -180,14 +180,16 @@ void rpcb_put_local(struct net *net) | |||
180 | struct sunrpc_net *sn = net_generic(net, sunrpc_net_id); | 180 | struct sunrpc_net *sn = net_generic(net, sunrpc_net_id); |
181 | struct rpc_clnt *clnt = sn->rpcb_local_clnt; | 181 | struct rpc_clnt *clnt = sn->rpcb_local_clnt; |
182 | struct rpc_clnt *clnt4 = sn->rpcb_local_clnt4; | 182 | struct rpc_clnt *clnt4 = sn->rpcb_local_clnt4; |
183 | int shutdown; | 183 | int shutdown = 0; |
184 | 184 | ||
185 | spin_lock(&sn->rpcb_clnt_lock); | 185 | spin_lock(&sn->rpcb_clnt_lock); |
186 | if (--sn->rpcb_users == 0) { | 186 | if (sn->rpcb_users) { |
187 | sn->rpcb_local_clnt = NULL; | 187 | if (--sn->rpcb_users == 0) { |
188 | sn->rpcb_local_clnt4 = NULL; | 188 | sn->rpcb_local_clnt = NULL; |
189 | sn->rpcb_local_clnt4 = NULL; | ||
190 | } | ||
191 | shutdown = !sn->rpcb_users; | ||
189 | } | 192 | } |
190 | shutdown = !sn->rpcb_users; | ||
191 | spin_unlock(&sn->rpcb_clnt_lock); | 193 | spin_unlock(&sn->rpcb_clnt_lock); |
192 | 194 | ||
193 | if (shutdown) { | 195 | if (shutdown) { |