Lines Matching refs:nn

161 int nfsd_vers(struct nfsd_net *nn, int vers, enum vers_op change)  in nfsd_vers()  argument
167 nn->nfsd_versions[vers] = nfsd_support_version(vers); in nfsd_vers()
170 nn->nfsd_versions[vers] = false; in nfsd_vers()
173 return nn->nfsd_versions[vers]; in nfsd_vers()
181 nfsd_adjust_nfsd_versions4(struct nfsd_net *nn) in nfsd_adjust_nfsd_versions4() argument
186 if (nn->nfsd4_minorversions[i]) in nfsd_adjust_nfsd_versions4()
189 nfsd_vers(nn, 4, NFSD_CLEAR); in nfsd_adjust_nfsd_versions4()
192 int nfsd_minorversion(struct nfsd_net *nn, u32 minorversion, enum vers_op change) in nfsd_minorversion() argument
200 nfsd_vers(nn, 4, NFSD_SET); in nfsd_minorversion()
201 nn->nfsd4_minorversions[minorversion] = in nfsd_minorversion()
202 nfsd_vers(nn, 4, NFSD_TEST); in nfsd_minorversion()
205 nn->nfsd4_minorversions[minorversion] = false; in nfsd_minorversion()
206 nfsd_adjust_nfsd_versions4(nn); in nfsd_minorversion()
209 return nn->nfsd4_minorversions[minorversion]; in nfsd_minorversion()
212 nfsd_vers(nn, 4, NFSD_AVAIL); in nfsd_minorversion()
219 struct nfsd_net *nn = net_generic(net, nfsd_net_id); in nfsd_serv_try_get() local
221 return (nn && percpu_ref_tryget_live(&nn->nfsd_serv_ref)); in nfsd_serv_try_get()
226 struct nfsd_net *nn = net_generic(net, nfsd_net_id); in nfsd_serv_put() local
228 percpu_ref_put(&nn->nfsd_serv_ref); in nfsd_serv_put()
233 struct nfsd_net *nn = container_of(ref, struct nfsd_net, nfsd_serv_ref); in nfsd_serv_done() local
235 complete(&nn->nfsd_serv_confirm_done); in nfsd_serv_done()
240 struct nfsd_net *nn = container_of(ref, struct nfsd_net, nfsd_serv_ref); in nfsd_serv_free() local
242 complete(&nn->nfsd_serv_free_done); in nfsd_serv_free()
253 struct nfsd_net *nn = net_generic(net, nfsd_net_id); in nfsd_nrthreads() local
256 if (nn->nfsd_serv) in nfsd_nrthreads()
257 rv = nn->nfsd_serv->sv_nrthreads; in nfsd_nrthreads()
265 struct nfsd_net *nn = net_generic(net, nfsd_net_id); in nfsd_init_socks() local
267 if (!list_empty(&nn->nfsd_serv->sv_permsocks)) in nfsd_init_socks()
270 error = svc_xprt_create(nn->nfsd_serv, "udp", net, PF_INET, NFS_PORT, in nfsd_init_socks()
275 error = svc_xprt_create(nn->nfsd_serv, "tcp", net, PF_INET, NFS_PORT, in nfsd_init_socks()
317 static bool nfsd_needs_lockd(struct nfsd_net *nn) in nfsd_needs_lockd() argument
319 return nfsd_vers(nn, 2, NFSD_TEST) || nfsd_vers(nn, 3, NFSD_TEST); in nfsd_needs_lockd()
330 void nfsd_copy_write_verifier(__be32 verf[2], struct nfsd_net *nn) in nfsd_copy_write_verifier() argument
335 seq = read_seqbegin(&nn->writeverf_lock); in nfsd_copy_write_verifier()
336 memcpy(verf, nn->writeverf, sizeof(nn->writeverf)); in nfsd_copy_write_verifier()
337 } while (read_seqretry(&nn->writeverf_lock, seq)); in nfsd_copy_write_verifier()
340 static void nfsd_reset_write_verifier_locked(struct nfsd_net *nn) in nfsd_reset_write_verifier_locked() argument
350 verf = siphash_2u64(now.tv_sec, now.tv_nsec, &nn->siphash_key); in nfsd_reset_write_verifier_locked()
351 memcpy(nn->writeverf, &verf, sizeof(nn->writeverf)); in nfsd_reset_write_verifier_locked()
367 void nfsd_reset_write_verifier(struct nfsd_net *nn) in nfsd_reset_write_verifier() argument
369 write_seqlock(&nn->writeverf_lock); in nfsd_reset_write_verifier()
370 nfsd_reset_write_verifier_locked(nn); in nfsd_reset_write_verifier()
371 write_sequnlock(&nn->writeverf_lock); in nfsd_reset_write_verifier()
381 struct nfsd_net *nn = net_generic(net, nfsd_net_id); in nfsd_startup_net() local
384 if (nn->nfsd_net_up) in nfsd_startup_net()
394 if (nfsd_needs_lockd(nn) && !nn->lockd_up) { in nfsd_startup_net()
398 nn->lockd_up = true; in nfsd_startup_net()
405 ret = nfsd_reply_cache_init(nn); in nfsd_startup_net()
414 nfsd4_ssc_init_umount_work(nn); in nfsd_startup_net()
416 nn->nfsd_net_up = true; in nfsd_startup_net()
420 nfsd_reply_cache_shutdown(nn); in nfsd_startup_net()
424 if (nn->lockd_up) { in nfsd_startup_net()
426 nn->lockd_up = false; in nfsd_startup_net()
435 struct nfsd_net *nn = net_generic(net, nfsd_net_id); in nfsd_shutdown_net() local
437 if (!nn->nfsd_net_up) in nfsd_shutdown_net()
441 nfsd_reply_cache_shutdown(nn); in nfsd_shutdown_net()
443 if (nn->lockd_up) { in nfsd_shutdown_net()
445 nn->lockd_up = false; in nfsd_shutdown_net()
447 percpu_ref_exit(&nn->nfsd_serv_ref); in nfsd_shutdown_net()
448 nn->nfsd_net_up = false; in nfsd_shutdown_net()
459 struct nfsd_net *nn = net_generic(net, nfsd_net_id); in nfsd_inetaddr_event() local
462 if (event != NETDEV_DOWN || !nn->nfsd_serv) in nfsd_inetaddr_event()
466 if (nn->nfsd_serv) { in nfsd_inetaddr_event()
470 svc_age_temp_xprts_now(nn->nfsd_serv, (struct sockaddr *)&sin); in nfsd_inetaddr_event()
489 struct nfsd_net *nn = net_generic(net, nfsd_net_id); in nfsd_inet6addr_event() local
492 if (event != NETDEV_DOWN || !nn->nfsd_serv) in nfsd_inet6addr_event()
496 if (nn->nfsd_serv) { in nfsd_inet6addr_event()
502 svc_age_temp_xprts_now(nn->nfsd_serv, (struct sockaddr *)&sin6); in nfsd_inet6addr_event()
524 struct nfsd_net *nn = net_generic(net, nfsd_net_id); in nfsd_destroy_serv() local
525 struct svc_serv *serv = nn->nfsd_serv; in nfsd_destroy_serv()
529 percpu_ref_kill_and_confirm(&nn->nfsd_serv_ref, nfsd_serv_done); in nfsd_destroy_serv()
530 wait_for_completion(&nn->nfsd_serv_confirm_done); in nfsd_destroy_serv()
531 wait_for_completion(&nn->nfsd_serv_free_done); in nfsd_destroy_serv()
535 nn->nfsd_serv = NULL; in nfsd_destroy_serv()
560 void nfsd_reset_versions(struct nfsd_net *nn) in nfsd_reset_versions() argument
565 if (nfsd_vers(nn, i, NFSD_TEST)) in nfsd_reset_versions()
570 nfsd_vers(nn, i, NFSD_SET); in nfsd_reset_versions()
573 while (nfsd_minorversion(nn, minor, NFSD_SET) >= 0) in nfsd_reset_versions()
622 struct nfsd_net *nn = net_generic(net, nfsd_net_id); in nfsd_shutdown_threads() local
626 serv = nn->nfsd_serv; in nfsd_shutdown_threads()
648 struct nfsd_net *nn = net_generic(net, nfsd_net_id); in nfsd_create_serv() local
652 if (nn->nfsd_serv) in nfsd_create_serv()
655 error = percpu_ref_init(&nn->nfsd_serv_ref, nfsd_serv_free, in nfsd_create_serv()
659 init_completion(&nn->nfsd_serv_free_done); in nfsd_create_serv()
660 init_completion(&nn->nfsd_serv_confirm_done); in nfsd_create_serv()
664 nfsd_reset_versions(nn); in nfsd_create_serv()
666 &nn->nfsd_svcstats, in nfsd_create_serv()
671 serv->sv_maxconn = nn->max_connections; in nfsd_create_serv()
678 nn->nfsd_serv = serv; in nfsd_create_serv()
689 nfsd_reset_write_verifier(nn); in nfsd_create_serv()
695 struct nfsd_net *nn = net_generic(net, nfsd_net_id); in nfsd_nrpools() local
697 if (nn->nfsd_serv == NULL) in nfsd_nrpools()
700 return nn->nfsd_serv->sv_nrpools; in nfsd_nrpools()
705 struct nfsd_net *nn = net_generic(net, nfsd_net_id); in nfsd_get_nrthreads() local
706 struct svc_serv *serv = nn->nfsd_serv; in nfsd_get_nrthreads()
733 struct nfsd_net *nn = net_generic(net, nfsd_net_id); in nfsd_set_nrthreads() local
737 if (nn->nfsd_serv == NULL || n <= 0) in nfsd_set_nrthreads()
745 return svc_set_num_threads(nn->nfsd_serv, NULL, nthreads[0]); in nfsd_set_nrthreads()
747 if (n > nn->nfsd_serv->sv_nrpools) in nfsd_set_nrthreads()
748 n = nn->nfsd_serv->sv_nrpools; in nfsd_set_nrthreads()
771 err = svc_set_num_threads(nn->nfsd_serv, in nfsd_set_nrthreads()
772 &nn->nfsd_serv->sv_pools[i], in nfsd_set_nrthreads()
779 for (i = n; i < nn->nfsd_serv->sv_nrpools; ++i) { in nfsd_set_nrthreads()
780 err = svc_set_num_threads(nn->nfsd_serv, in nfsd_set_nrthreads()
781 &nn->nfsd_serv->sv_pools[i], in nfsd_set_nrthreads()
805 struct nfsd_net *nn = net_generic(net, nfsd_net_id); in nfsd_svc() local
812 strscpy(nn->nfsd_name, scope ? scope : utsname()->nodename, in nfsd_svc()
813 sizeof(nn->nfsd_name)); in nfsd_svc()
818 serv = nn->nfsd_serv; in nfsd_svc()
860 struct nfsd_net *nn = net_generic(SVC_NET(rqstp), nfsd_net_id); in nfsd_acl_init_request() local
864 nfsd_vers(nn, rqstp->rq_vers, NFSD_TEST))) in nfsd_acl_init_request()
870 nfsd_vers(nn, i, NFSD_TEST)) { in nfsd_acl_init_request()
880 nfsd_vers(nn, i, NFSD_TEST)) { in nfsd_acl_init_request()
905 struct nfsd_net *nn = net_generic(SVC_NET(rqstp), nfsd_net_id); in nfsd_init_request() local
908 if (likely(nfsd_vers(nn, rqstp->rq_vers, NFSD_TEST))) in nfsd_init_request()
913 if (nfsd_vers(nn, i, NFSD_TEST)) { in nfsd_init_request()
922 if (nfsd_vers(nn, i, NFSD_TEST)) { in nfsd_init_request()
939 struct nfsd_net *nn = net_generic(net, nfsd_net_id); in nfsd() local
958 rqstp->rq_server->sv_maxconn = nn->max_connections; in nfsd()
962 nfsd_file_net_dispose(nn); in nfsd()