Lines Matching refs:nn

184 nfsd_netns_free_versions(struct nfsd_net *nn)  in nfsd_netns_free_versions()  argument
186 kfree(nn->nfsd_versions); in nfsd_netns_free_versions()
187 kfree(nn->nfsd4_minorversions); in nfsd_netns_free_versions()
188 nn->nfsd_versions = NULL; in nfsd_netns_free_versions()
189 nn->nfsd4_minorversions = NULL; in nfsd_netns_free_versions()
193 nfsd_netns_init_versions(struct nfsd_net *nn) in nfsd_netns_init_versions() argument
195 if (!nn->nfsd_versions) { in nfsd_netns_init_versions()
196 nn->nfsd_versions = nfsd_alloc_versions(); in nfsd_netns_init_versions()
197 nn->nfsd4_minorversions = nfsd_alloc_minorversions(); in nfsd_netns_init_versions()
198 if (!nn->nfsd_versions || !nn->nfsd4_minorversions) in nfsd_netns_init_versions()
199 nfsd_netns_free_versions(nn); in nfsd_netns_init_versions()
203 int nfsd_vers(struct nfsd_net *nn, int vers, enum vers_op change) in nfsd_vers() argument
209 if (nn->nfsd_versions) in nfsd_vers()
210 nn->nfsd_versions[vers] = nfsd_support_version(vers); in nfsd_vers()
213 nfsd_netns_init_versions(nn); in nfsd_vers()
214 if (nn->nfsd_versions) in nfsd_vers()
215 nn->nfsd_versions[vers] = false; in nfsd_vers()
218 if (nn->nfsd_versions) in nfsd_vers()
219 return nn->nfsd_versions[vers]; in nfsd_vers()
228 nfsd_adjust_nfsd_versions4(struct nfsd_net *nn) in nfsd_adjust_nfsd_versions4() argument
233 if (nn->nfsd4_minorversions[i]) in nfsd_adjust_nfsd_versions4()
236 nfsd_vers(nn, 4, NFSD_CLEAR); in nfsd_adjust_nfsd_versions4()
239 int nfsd_minorversion(struct nfsd_net *nn, u32 minorversion, enum vers_op change) in nfsd_minorversion() argument
247 if (nn->nfsd4_minorversions) { in nfsd_minorversion()
248 nfsd_vers(nn, 4, NFSD_SET); in nfsd_minorversion()
249 nn->nfsd4_minorversions[minorversion] = in nfsd_minorversion()
250 nfsd_vers(nn, 4, NFSD_TEST); in nfsd_minorversion()
254 nfsd_netns_init_versions(nn); in nfsd_minorversion()
255 if (nn->nfsd4_minorversions) { in nfsd_minorversion()
256 nn->nfsd4_minorversions[minorversion] = false; in nfsd_minorversion()
257 nfsd_adjust_nfsd_versions4(nn); in nfsd_minorversion()
261 if (nn->nfsd4_minorversions) in nfsd_minorversion()
262 return nn->nfsd4_minorversions[minorversion]; in nfsd_minorversion()
263 return nfsd_vers(nn, 4, NFSD_TEST); in nfsd_minorversion()
266 nfsd_vers(nn, 4, NFSD_AVAIL); in nfsd_minorversion()
279 struct nfsd_net *nn = net_generic(net, nfsd_net_id); in nfsd_nrthreads() local
282 if (nn->nfsd_serv) in nfsd_nrthreads()
283 rv = nn->nfsd_serv->sv_nrthreads; in nfsd_nrthreads()
291 struct nfsd_net *nn = net_generic(net, nfsd_net_id); in nfsd_init_socks() local
293 if (!list_empty(&nn->nfsd_serv->sv_permsocks)) in nfsd_init_socks()
296 error = svc_create_xprt(nn->nfsd_serv, "udp", net, PF_INET, NFS_PORT, in nfsd_init_socks()
301 error = svc_create_xprt(nn->nfsd_serv, "tcp", net, PF_INET, NFS_PORT, in nfsd_init_socks()
343 static bool nfsd_needs_lockd(struct nfsd_net *nn) in nfsd_needs_lockd() argument
345 return nfsd_vers(nn, 2, NFSD_TEST) || nfsd_vers(nn, 3, NFSD_TEST); in nfsd_needs_lockd()
348 void nfsd_copy_boot_verifier(__be32 verf[2], struct nfsd_net *nn) in nfsd_copy_boot_verifier() argument
353 read_seqbegin_or_lock(&nn->boot_lock, &seq); in nfsd_copy_boot_verifier()
359 verf[0] = (__force __be32)nn->nfssvc_boot.tv_sec; in nfsd_copy_boot_verifier()
360 verf[1] = (__force __be32)nn->nfssvc_boot.tv_nsec; in nfsd_copy_boot_verifier()
361 } while (need_seqretry(&nn->boot_lock, seq)); in nfsd_copy_boot_verifier()
362 done_seqretry(&nn->boot_lock, seq); in nfsd_copy_boot_verifier()
365 static void nfsd_reset_boot_verifier_locked(struct nfsd_net *nn) in nfsd_reset_boot_verifier_locked() argument
367 ktime_get_real_ts64(&nn->nfssvc_boot); in nfsd_reset_boot_verifier_locked()
370 void nfsd_reset_boot_verifier(struct nfsd_net *nn) in nfsd_reset_boot_verifier() argument
372 write_seqlock(&nn->boot_lock); in nfsd_reset_boot_verifier()
373 nfsd_reset_boot_verifier_locked(nn); in nfsd_reset_boot_verifier()
374 write_sequnlock(&nn->boot_lock); in nfsd_reset_boot_verifier()
379 struct nfsd_net *nn = net_generic(net, nfsd_net_id); in nfsd_startup_net() local
382 if (nn->nfsd_net_up) in nfsd_startup_net()
392 if (nfsd_needs_lockd(nn) && !nn->lockd_up) { in nfsd_startup_net()
396 nn->lockd_up = true; in nfsd_startup_net()
407 nfsd4_ssc_init_umount_work(nn); in nfsd_startup_net()
409 nn->nfsd_net_up = true; in nfsd_startup_net()
415 if (nn->lockd_up) { in nfsd_startup_net()
417 nn->lockd_up = false; in nfsd_startup_net()
426 struct nfsd_net *nn = net_generic(net, nfsd_net_id); in nfsd_shutdown_net() local
430 if (nn->lockd_up) { in nfsd_shutdown_net()
432 nn->lockd_up = false; in nfsd_shutdown_net()
434 nn->nfsd_net_up = false; in nfsd_shutdown_net()
444 struct nfsd_net *nn = net_generic(net, nfsd_net_id); in nfsd_inetaddr_event() local
448 !atomic_inc_not_zero(&nn->ntf_refcnt)) in nfsd_inetaddr_event()
451 if (nn->nfsd_serv) { in nfsd_inetaddr_event()
455 svc_age_temp_xprts_now(nn->nfsd_serv, (struct sockaddr *)&sin); in nfsd_inetaddr_event()
457 atomic_dec(&nn->ntf_refcnt); in nfsd_inetaddr_event()
458 wake_up(&nn->ntf_wq); in nfsd_inetaddr_event()
475 struct nfsd_net *nn = net_generic(net, nfsd_net_id); in nfsd_inet6addr_event() local
479 !atomic_inc_not_zero(&nn->ntf_refcnt)) in nfsd_inet6addr_event()
482 if (nn->nfsd_serv) { in nfsd_inet6addr_event()
488 svc_age_temp_xprts_now(nn->nfsd_serv, (struct sockaddr *)&sin6); in nfsd_inet6addr_event()
490 atomic_dec(&nn->ntf_refcnt); in nfsd_inet6addr_event()
491 wake_up(&nn->ntf_wq); in nfsd_inet6addr_event()
506 struct nfsd_net *nn = net_generic(net, nfsd_net_id); in nfsd_last_thread() local
508 atomic_dec(&nn->ntf_refcnt); in nfsd_last_thread()
516 wait_event(nn->ntf_wq, atomic_read(&nn->ntf_refcnt) == 0); in nfsd_last_thread()
525 if (!nn->nfsd_net_up) in nfsd_last_thread()
533 void nfsd_reset_versions(struct nfsd_net *nn) in nfsd_reset_versions() argument
538 if (nfsd_vers(nn, i, NFSD_TEST)) in nfsd_reset_versions()
543 nfsd_vers(nn, i, NFSD_SET); in nfsd_reset_versions()
546 while (nfsd_minorversion(nn, minor, NFSD_SET) >= 0) in nfsd_reset_versions()
603 struct nfsd_net *nn = net_generic(net, nfsd_net_id); in nfsd_complete_shutdown() local
607 nn->nfsd_serv = NULL; in nfsd_complete_shutdown()
608 complete(&nn->nfsd_shutdown_complete); in nfsd_complete_shutdown()
613 struct nfsd_net *nn = net_generic(net, nfsd_net_id); in nfsd_shutdown_threads() local
617 serv = nn->nfsd_serv; in nfsd_shutdown_threads()
629 wait_for_completion(&nn->nfsd_shutdown_complete); in nfsd_shutdown_threads()
640 struct nfsd_net *nn = net_generic(net, nfsd_net_id); in nfsd_create_serv() local
643 if (nn->nfsd_serv) { in nfsd_create_serv()
644 svc_get(nn->nfsd_serv); in nfsd_create_serv()
649 nfsd_reset_versions(nn); in nfsd_create_serv()
650 nn->nfsd_serv = svc_create_pooled(&nfsd_program, nfsd_max_blksize, in nfsd_create_serv()
652 if (nn->nfsd_serv == NULL) in nfsd_create_serv()
654 init_completion(&nn->nfsd_shutdown_complete); in nfsd_create_serv()
656 nn->nfsd_serv->sv_maxconn = nn->max_connections; in nfsd_create_serv()
657 error = svc_bind(nn->nfsd_serv, net); in nfsd_create_serv()
659 svc_destroy(nn->nfsd_serv); in nfsd_create_serv()
672 atomic_inc(&nn->ntf_refcnt); in nfsd_create_serv()
673 nfsd_reset_boot_verifier(nn); in nfsd_create_serv()
679 struct nfsd_net *nn = net_generic(net, nfsd_net_id); in nfsd_nrpools() local
681 if (nn->nfsd_serv == NULL) in nfsd_nrpools()
684 return nn->nfsd_serv->sv_nrpools; in nfsd_nrpools()
690 struct nfsd_net *nn = net_generic(net, nfsd_net_id); in nfsd_get_nrthreads() local
692 if (nn->nfsd_serv != NULL) { in nfsd_get_nrthreads()
693 for (i = 0; i < nn->nfsd_serv->sv_nrpools && i < n; i++) in nfsd_get_nrthreads()
694 nthreads[i] = nn->nfsd_serv->sv_pools[i].sp_nrthreads; in nfsd_get_nrthreads()
702 struct nfsd_net *nn = net_generic(net, nfsd_net_id); in nfsd_destroy() local
703 int destroy = (nn->nfsd_serv->sv_nrthreads == 1); in nfsd_destroy()
706 svc_shutdown_net(nn->nfsd_serv, net); in nfsd_destroy()
707 svc_destroy(nn->nfsd_serv); in nfsd_destroy()
717 struct nfsd_net *nn = net_generic(net, nfsd_net_id); in nfsd_set_nrthreads() local
721 if (nn->nfsd_serv == NULL || n <= 0) in nfsd_set_nrthreads()
724 if (n > nn->nfsd_serv->sv_nrpools) in nfsd_set_nrthreads()
725 n = nn->nfsd_serv->sv_nrpools; in nfsd_set_nrthreads()
754 svc_get(nn->nfsd_serv); in nfsd_set_nrthreads()
756 err = nn->nfsd_serv->sv_ops->svo_setup(nn->nfsd_serv, in nfsd_set_nrthreads()
757 &nn->nfsd_serv->sv_pools[i], nthreads[i]); in nfsd_set_nrthreads()
775 struct nfsd_net *nn = net_generic(net, nfsd_net_id); in nfsd_svc() local
784 if (nrservs == 0 && nn->nfsd_serv == NULL) in nfsd_svc()
787 strlcpy(nn->nfsd_name, utsname()->nodename, in nfsd_svc()
788 sizeof(nn->nfsd_name)); in nfsd_svc()
794 nfsd_up_before = nn->nfsd_net_up; in nfsd_svc()
799 error = nn->nfsd_serv->sv_ops->svo_setup(nn->nfsd_serv, in nfsd_svc()
807 error = nn->nfsd_serv->sv_nrthreads - 1; in nfsd_svc()
844 struct nfsd_net *nn = net_generic(SVC_NET(rqstp), nfsd_net_id); in nfsd_acl_init_request() local
848 nfsd_vers(nn, rqstp->rq_vers, NFSD_TEST))) in nfsd_acl_init_request()
854 nfsd_vers(nn, i, NFSD_TEST)) { in nfsd_acl_init_request()
864 nfsd_vers(nn, i, NFSD_TEST)) { in nfsd_acl_init_request()
889 struct nfsd_net *nn = net_generic(SVC_NET(rqstp), nfsd_net_id); in nfsd_init_request() local
892 if (likely(nfsd_vers(nn, rqstp->rq_vers, NFSD_TEST))) in nfsd_init_request()
897 if (nfsd_vers(nn, i, NFSD_TEST)) { in nfsd_init_request()
906 if (nfsd_vers(nn, i, NFSD_TEST)) { in nfsd_init_request()
923 struct nfsd_net *nn = net_generic(net, nfsd_net_id); in nfsd() local
958 rqstp->rq_server->sv_maxconn = nn->max_connections; in nfsd()
1092 struct nfsd_net *nn = net_generic(inode->i_sb->s_fs_info, nfsd_net_id); in nfsd_pool_stats_open() local
1095 if (nn->nfsd_serv == NULL) { in nfsd_pool_stats_open()
1100 svc_get(nn->nfsd_serv); in nfsd_pool_stats_open()
1101 ret = svc_pool_stats_open(nn->nfsd_serv, file); in nfsd_pool_stats_open()