Lines Matching refs:nn

182 nfsd_netns_free_versions(struct nfsd_net *nn)  in nfsd_netns_free_versions()  argument
184 kfree(nn->nfsd_versions); in nfsd_netns_free_versions()
185 kfree(nn->nfsd4_minorversions); in nfsd_netns_free_versions()
186 nn->nfsd_versions = NULL; in nfsd_netns_free_versions()
187 nn->nfsd4_minorversions = NULL; in nfsd_netns_free_versions()
191 nfsd_netns_init_versions(struct nfsd_net *nn) in nfsd_netns_init_versions() argument
193 if (!nn->nfsd_versions) { in nfsd_netns_init_versions()
194 nn->nfsd_versions = nfsd_alloc_versions(); in nfsd_netns_init_versions()
195 nn->nfsd4_minorversions = nfsd_alloc_minorversions(); in nfsd_netns_init_versions()
196 if (!nn->nfsd_versions || !nn->nfsd4_minorversions) in nfsd_netns_init_versions()
197 nfsd_netns_free_versions(nn); in nfsd_netns_init_versions()
201 int nfsd_vers(struct nfsd_net *nn, int vers, enum vers_op change) in nfsd_vers() argument
207 if (nn->nfsd_versions) in nfsd_vers()
208 nn->nfsd_versions[vers] = nfsd_support_version(vers); in nfsd_vers()
211 nfsd_netns_init_versions(nn); in nfsd_vers()
212 if (nn->nfsd_versions) in nfsd_vers()
213 nn->nfsd_versions[vers] = false; in nfsd_vers()
216 if (nn->nfsd_versions) in nfsd_vers()
217 return nn->nfsd_versions[vers]; in nfsd_vers()
226 nfsd_adjust_nfsd_versions4(struct nfsd_net *nn) in nfsd_adjust_nfsd_versions4() argument
231 if (nn->nfsd4_minorversions[i]) in nfsd_adjust_nfsd_versions4()
234 nfsd_vers(nn, 4, NFSD_CLEAR); in nfsd_adjust_nfsd_versions4()
237 int nfsd_minorversion(struct nfsd_net *nn, u32 minorversion, enum vers_op change) in nfsd_minorversion() argument
245 if (nn->nfsd4_minorversions) { in nfsd_minorversion()
246 nfsd_vers(nn, 4, NFSD_SET); in nfsd_minorversion()
247 nn->nfsd4_minorversions[minorversion] = in nfsd_minorversion()
248 nfsd_vers(nn, 4, NFSD_TEST); in nfsd_minorversion()
252 nfsd_netns_init_versions(nn); in nfsd_minorversion()
253 if (nn->nfsd4_minorversions) { in nfsd_minorversion()
254 nn->nfsd4_minorversions[minorversion] = false; in nfsd_minorversion()
255 nfsd_adjust_nfsd_versions4(nn); in nfsd_minorversion()
259 if (nn->nfsd4_minorversions) in nfsd_minorversion()
260 return nn->nfsd4_minorversions[minorversion]; in nfsd_minorversion()
261 return nfsd_vers(nn, 4, NFSD_TEST); in nfsd_minorversion()
264 nfsd_vers(nn, 4, NFSD_AVAIL); in nfsd_minorversion()
277 struct nfsd_net *nn = net_generic(net, nfsd_net_id); in nfsd_nrthreads() local
280 if (nn->nfsd_serv) in nfsd_nrthreads()
281 rv = nn->nfsd_serv->sv_nrthreads; in nfsd_nrthreads()
289 struct nfsd_net *nn = net_generic(net, nfsd_net_id); in nfsd_init_socks() local
291 if (!list_empty(&nn->nfsd_serv->sv_permsocks)) in nfsd_init_socks()
294 error = svc_xprt_create(nn->nfsd_serv, "udp", net, PF_INET, NFS_PORT, in nfsd_init_socks()
299 error = svc_xprt_create(nn->nfsd_serv, "tcp", net, PF_INET, NFS_PORT, in nfsd_init_socks()
341 static bool nfsd_needs_lockd(struct nfsd_net *nn) in nfsd_needs_lockd() argument
343 return nfsd_vers(nn, 2, NFSD_TEST) || nfsd_vers(nn, 3, NFSD_TEST); in nfsd_needs_lockd()
354 void nfsd_copy_write_verifier(__be32 verf[2], struct nfsd_net *nn) in nfsd_copy_write_verifier() argument
359 read_seqbegin_or_lock(&nn->writeverf_lock, &seq); in nfsd_copy_write_verifier()
360 memcpy(verf, nn->writeverf, sizeof(*verf)); in nfsd_copy_write_verifier()
361 } while (need_seqretry(&nn->writeverf_lock, seq)); in nfsd_copy_write_verifier()
362 done_seqretry(&nn->writeverf_lock, seq); in nfsd_copy_write_verifier()
365 static void nfsd_reset_write_verifier_locked(struct nfsd_net *nn) in nfsd_reset_write_verifier_locked() argument
375 verf = siphash_2u64(now.tv_sec, now.tv_nsec, &nn->siphash_key); in nfsd_reset_write_verifier_locked()
376 memcpy(nn->writeverf, &verf, sizeof(nn->writeverf)); in nfsd_reset_write_verifier_locked()
392 void nfsd_reset_write_verifier(struct nfsd_net *nn) in nfsd_reset_write_verifier() argument
394 write_seqlock(&nn->writeverf_lock); in nfsd_reset_write_verifier()
395 nfsd_reset_write_verifier_locked(nn); in nfsd_reset_write_verifier()
396 write_sequnlock(&nn->writeverf_lock); in nfsd_reset_write_verifier()
401 struct nfsd_net *nn = net_generic(net, nfsd_net_id); in nfsd_startup_net() local
404 if (nn->nfsd_net_up) in nfsd_startup_net()
414 if (nfsd_needs_lockd(nn) && !nn->lockd_up) { in nfsd_startup_net()
418 nn->lockd_up = true; in nfsd_startup_net()
429 nfsd4_ssc_init_umount_work(nn); in nfsd_startup_net()
431 nn->nfsd_net_up = true; in nfsd_startup_net()
437 if (nn->lockd_up) { in nfsd_startup_net()
439 nn->lockd_up = false; in nfsd_startup_net()
448 struct nfsd_net *nn = net_generic(net, nfsd_net_id); in nfsd_shutdown_net() local
452 if (nn->lockd_up) { in nfsd_shutdown_net()
454 nn->lockd_up = false; in nfsd_shutdown_net()
456 nn->nfsd_net_up = false; in nfsd_shutdown_net()
467 struct nfsd_net *nn = net_generic(net, nfsd_net_id); in nfsd_inetaddr_event() local
470 if (event != NETDEV_DOWN || !nn->nfsd_serv) in nfsd_inetaddr_event()
474 if (nn->nfsd_serv) { in nfsd_inetaddr_event()
478 svc_age_temp_xprts_now(nn->nfsd_serv, (struct sockaddr *)&sin); in nfsd_inetaddr_event()
497 struct nfsd_net *nn = net_generic(net, nfsd_net_id); in nfsd_inet6addr_event() local
500 if (event != NETDEV_DOWN || !nn->nfsd_serv) in nfsd_inet6addr_event()
504 if (nn->nfsd_serv) { in nfsd_inet6addr_event()
510 svc_age_temp_xprts_now(nn->nfsd_serv, (struct sockaddr *)&sin6); in nfsd_inet6addr_event()
528 struct nfsd_net *nn = net_generic(net, nfsd_net_id); in nfsd_last_thread() local
545 if (!nn->nfsd_net_up) in nfsd_last_thread()
553 void nfsd_reset_versions(struct nfsd_net *nn) in nfsd_reset_versions() argument
558 if (nfsd_vers(nn, i, NFSD_TEST)) in nfsd_reset_versions()
563 nfsd_vers(nn, i, NFSD_SET); in nfsd_reset_versions()
566 while (nfsd_minorversion(nn, minor, NFSD_SET) >= 0) in nfsd_reset_versions()
615 struct nfsd_net *nn = net_generic(net, nfsd_net_id); in nfsd_shutdown_threads() local
619 serv = nn->nfsd_serv; in nfsd_shutdown_threads()
640 struct nfsd_net *nn = net_generic(net, nfsd_net_id); in nfsd_create_serv() local
644 if (nn->nfsd_serv) { in nfsd_create_serv()
645 svc_get(nn->nfsd_serv); in nfsd_create_serv()
650 nfsd_reset_versions(nn); in nfsd_create_serv()
655 serv->sv_maxconn = nn->max_connections; in nfsd_create_serv()
665 nn->nfsd_serv = serv; in nfsd_create_serv()
676 nfsd_reset_write_verifier(nn); in nfsd_create_serv()
682 struct nfsd_net *nn = net_generic(net, nfsd_net_id); in nfsd_nrpools() local
684 if (nn->nfsd_serv == NULL) in nfsd_nrpools()
687 return nn->nfsd_serv->sv_nrpools; in nfsd_nrpools()
693 struct nfsd_net *nn = net_generic(net, nfsd_net_id); in nfsd_get_nrthreads() local
695 if (nn->nfsd_serv != NULL) { in nfsd_get_nrthreads()
696 for (i = 0; i < nn->nfsd_serv->sv_nrpools && i < n; i++) in nfsd_get_nrthreads()
697 nthreads[i] = nn->nfsd_serv->sv_pools[i].sp_nrthreads; in nfsd_get_nrthreads()
714 struct nfsd_net *nn = net_generic(net, nfsd_net_id); in nfsd_put() local
716 if (kref_put(&nn->nfsd_serv->sv_refcnt, nfsd_noop)) { in nfsd_put()
717 svc_xprt_destroy_all(nn->nfsd_serv, net); in nfsd_put()
718 nfsd_last_thread(nn->nfsd_serv, net); in nfsd_put()
719 svc_destroy(&nn->nfsd_serv->sv_refcnt); in nfsd_put()
721 nn->nfsd_serv = NULL; in nfsd_put()
731 struct nfsd_net *nn = net_generic(net, nfsd_net_id); in nfsd_set_nrthreads() local
735 if (nn->nfsd_serv == NULL || n <= 0) in nfsd_set_nrthreads()
738 if (n > nn->nfsd_serv->sv_nrpools) in nfsd_set_nrthreads()
739 n = nn->nfsd_serv->sv_nrpools; in nfsd_set_nrthreads()
768 svc_get(nn->nfsd_serv); in nfsd_set_nrthreads()
770 err = svc_set_num_threads(nn->nfsd_serv, in nfsd_set_nrthreads()
771 &nn->nfsd_serv->sv_pools[i], in nfsd_set_nrthreads()
790 struct nfsd_net *nn = net_generic(net, nfsd_net_id); in nfsd_svc() local
799 if (nrservs == 0 && nn->nfsd_serv == NULL) in nfsd_svc()
802 strscpy(nn->nfsd_name, utsname()->nodename, in nfsd_svc()
803 sizeof(nn->nfsd_name)); in nfsd_svc()
809 nfsd_up_before = nn->nfsd_net_up; in nfsd_svc()
814 error = svc_set_num_threads(nn->nfsd_serv, NULL, nrservs); in nfsd_svc()
817 error = nn->nfsd_serv->sv_nrthreads; in nfsd_svc()
823 if (xchg(&nn->keep_active, 0)) in nfsd_svc()
857 struct nfsd_net *nn = net_generic(SVC_NET(rqstp), nfsd_net_id); in nfsd_acl_init_request() local
861 nfsd_vers(nn, rqstp->rq_vers, NFSD_TEST))) in nfsd_acl_init_request()
867 nfsd_vers(nn, i, NFSD_TEST)) { in nfsd_acl_init_request()
877 nfsd_vers(nn, i, NFSD_TEST)) { in nfsd_acl_init_request()
902 struct nfsd_net *nn = net_generic(SVC_NET(rqstp), nfsd_net_id); in nfsd_init_request() local
905 if (likely(nfsd_vers(nn, rqstp->rq_vers, NFSD_TEST))) in nfsd_init_request()
910 if (nfsd_vers(nn, i, NFSD_TEST)) { in nfsd_init_request()
919 if (nfsd_vers(nn, i, NFSD_TEST)) { in nfsd_init_request()
936 struct nfsd_net *nn = net_generic(net, nfsd_net_id); in nfsd() local
967 rqstp->rq_server->sv_maxconn = nn->max_connections; in nfsd()
991 svc_get(nn->nfsd_serv); in nfsd()
1004 while (!svc_put_not_last(nn->nfsd_serv)) { in nfsd()
1115 struct nfsd_net *nn = net_generic(inode->i_sb->s_fs_info, nfsd_net_id); in nfsd_pool_stats_open() local
1118 if (nn->nfsd_serv == NULL) { in nfsd_pool_stats_open()
1122 svc_get(nn->nfsd_serv); in nfsd_pool_stats_open()
1123 ret = svc_pool_stats_open(nn->nfsd_serv, file); in nfsd_pool_stats_open()