Lines Matching refs:sn
168 struct sunrpc_net *sn = net_generic(net, sunrpc_net_id); in rpcb_get_local() local
170 spin_lock(&sn->rpcb_clnt_lock); in rpcb_get_local()
171 if (sn->rpcb_users) in rpcb_get_local()
172 sn->rpcb_users++; in rpcb_get_local()
173 cnt = sn->rpcb_users; in rpcb_get_local()
174 spin_unlock(&sn->rpcb_clnt_lock); in rpcb_get_local()
181 struct sunrpc_net *sn = net_generic(net, sunrpc_net_id); in rpcb_put_local() local
182 struct rpc_clnt *clnt = sn->rpcb_local_clnt; in rpcb_put_local()
183 struct rpc_clnt *clnt4 = sn->rpcb_local_clnt4; in rpcb_put_local()
186 spin_lock(&sn->rpcb_clnt_lock); in rpcb_put_local()
187 if (sn->rpcb_users) { in rpcb_put_local()
188 if (--sn->rpcb_users == 0) { in rpcb_put_local()
189 sn->rpcb_local_clnt = NULL; in rpcb_put_local()
190 sn->rpcb_local_clnt4 = NULL; in rpcb_put_local()
192 shutdown = !sn->rpcb_users; in rpcb_put_local()
194 spin_unlock(&sn->rpcb_clnt_lock); in rpcb_put_local()
211 struct sunrpc_net *sn = net_generic(net, sunrpc_net_id); in rpcb_set_local() local
214 sn->rpcb_local_clnt = clnt; in rpcb_set_local()
215 sn->rpcb_local_clnt4 = clnt4; in rpcb_set_local()
216 sn->rpcb_is_af_local = is_af_local ? 1 : 0; in rpcb_set_local()
218 sn->rpcb_users = 1; in rpcb_set_local()
221 sn->rpcb_local_clnt, sn->rpcb_local_clnt4, in rpcb_set_local()
396 static int rpcb_register_call(struct sunrpc_net *sn, struct rpc_clnt *clnt, struct rpc_message *msg… in rpcb_register_call() argument
401 if (is_set || !sn->rpcb_is_af_local) in rpcb_register_call()
461 struct sunrpc_net *sn = net_generic(net, sunrpc_net_id); in rpcb_register() local
474 return rpcb_register_call(sn, sn->rpcb_local_clnt, &msg, is_set); in rpcb_register()
480 static int rpcb_register_inet4(struct sunrpc_net *sn, in rpcb_register_inet4() argument
503 result = rpcb_register_call(sn, sn->rpcb_local_clnt4, msg, is_set); in rpcb_register_inet4()
511 static int rpcb_register_inet6(struct sunrpc_net *sn, in rpcb_register_inet6() argument
534 result = rpcb_register_call(sn, sn->rpcb_local_clnt4, msg, is_set); in rpcb_register_inet6()
539 static int rpcb_unregister_all_protofamilies(struct sunrpc_net *sn, in rpcb_unregister_all_protofamilies() argument
551 return rpcb_register_call(sn, sn->rpcb_local_clnt4, msg, false); in rpcb_unregister_all_protofamilies()
610 struct sunrpc_net *sn = net_generic(net, sunrpc_net_id); in rpcb_v4_register() local
612 if (sn->rpcb_local_clnt4 == NULL) in rpcb_v4_register()
616 return rpcb_unregister_all_protofamilies(sn, &msg); in rpcb_v4_register()
620 return rpcb_register_inet4(sn, address, &msg); in rpcb_v4_register()
622 return rpcb_register_inet6(sn, address, &msg); in rpcb_v4_register()