Lines Matching +full:fails +full:- +full:without +full:- +full:test +full:- +full:cd

1 // SPDX-License-Identifier: GPL-2.0
32 * One maps client+vfsmnt+dentry to export options - the export map
33 * The other maps client+filehandle-fragment to export options. - the expkey map
41 #define EXPKEY_HASHMASK (EXPKEY_HASHMAX -1)
47 if (test_bit(CACHE_VALID, &key->h.flags) && in expkey_put()
48 !test_bit(CACHE_NEGATIVE, &key->h.flags)) in expkey_put()
49 path_put(&key->ek_path); in expkey_put()
50 auth_domain_put(key->ek_client); in expkey_put()
54 static int expkey_upcall(struct cache_detail *cd, struct cache_head *h) in expkey_upcall() argument
56 return sunrpc_cache_pipe_upcall(cd, h); in expkey_upcall()
59 static void expkey_request(struct cache_detail *cd, in expkey_request() argument
67 qword_add(bpp, blen, ek->ek_client->name); in expkey_request()
68 snprintf(type, 5, "%d", ek->ek_fsidtype); in expkey_request()
70 qword_addhex(bpp, blen, (char*)ek->ek_fsid, key_len(ek->ek_fsidtype)); in expkey_request()
71 (*bpp)[-1] = '\n'; in expkey_request()
74 static struct svc_expkey *svc_expkey_update(struct cache_detail *cd, struct svc_expkey *new,
76 static struct svc_expkey *svc_expkey_lookup(struct cache_detail *cd, struct svc_expkey *);
78 static int expkey_parse(struct cache_detail *cd, char *mesg, int mlen) in expkey_parse() argument
90 if (mesg[mlen - 1] != '\n') in expkey_parse()
91 return -EINVAL; in expkey_parse()
92 mesg[mlen-1] = 0; in expkey_parse()
95 err = -ENOMEM; in expkey_parse()
99 err = -EINVAL; in expkey_parse()
103 err = -ENOENT; in expkey_parse()
109 err = -EINVAL; in expkey_parse()
134 ek = svc_expkey_lookup(cd, &key); in expkey_parse()
135 err = -ENOMEM; in expkey_parse()
140 err = -EINVAL; in expkey_parse()
148 ek = svc_expkey_update(cd, &key, ek); in expkey_parse()
152 err = -ENOMEM; in expkey_parse()
160 ek = svc_expkey_update(cd, &key, ek); in expkey_parse()
164 err = -ENOMEM; in expkey_parse()
170 cache_put(&ek->h, cd); in expkey_parse()
178 struct cache_detail *cd, in expkey_show() argument
189 seq_printf(m, "%s %d 0x", ek->ek_client->name, in expkey_show()
190 ek->ek_fsidtype); in expkey_show()
191 for (i=0; i < key_len(ek->ek_fsidtype)/4; i++) in expkey_show()
192 seq_printf(m, "%08x", ek->ek_fsid[i]); in expkey_show()
193 if (test_bit(CACHE_VALID, &h->flags) && in expkey_show()
194 !test_bit(CACHE_NEGATIVE, &h->flags)) { in expkey_show()
196 seq_path(m, &ek->ek_path, "\\ \t\n"); in expkey_show()
207 if (orig->ek_fsidtype != new->ek_fsidtype || in expkey_match()
208 orig->ek_client != new->ek_client || in expkey_match()
209 memcmp(orig->ek_fsid, new->ek_fsid, key_len(orig->ek_fsidtype)) != 0) in expkey_match()
220 kref_get(&item->ek_client->ref); in expkey_init()
221 new->ek_client = item->ek_client; in expkey_init()
222 new->ek_fsidtype = item->ek_fsidtype; in expkey_init()
224 memcpy(new->ek_fsid, item->ek_fsid, sizeof(new->ek_fsid)); in expkey_init()
233 new->ek_path = item->ek_path; in expkey_update()
234 path_get(&item->ek_path); in expkey_update()
241 return &i->h; in expkey_alloc()
253 nfsd_file_cache_purge(current->nsproxy->net_ns); in expkey_flush()
276 int hash = item->ek_fsidtype; in svc_expkey_hash()
277 char * cp = (char*)item->ek_fsid; in svc_expkey_hash()
278 int len = key_len(item->ek_fsidtype); in svc_expkey_hash()
281 hash ^= hash_ptr(item->ek_client, EXPKEY_HASHBITS); in svc_expkey_hash()
287 svc_expkey_lookup(struct cache_detail *cd, struct svc_expkey *item) in svc_expkey_lookup() argument
292 ch = sunrpc_cache_lookup_rcu(cd, &item->h, hash); in svc_expkey_lookup()
300 svc_expkey_update(struct cache_detail *cd, struct svc_expkey *new, in svc_expkey_update() argument
306 ch = sunrpc_cache_update(cd, &new->h, &old->h, hash); in svc_expkey_update()
319 struct nfsd4_fs_location *locations = fsloc->locations; in nfsd4_fslocs_free()
325 for (i = 0; i < fsloc->locations_count; i++) { in nfsd4_fslocs_free()
331 fsloc->locations = NULL; in nfsd4_fslocs_free()
336 stats->start_time = ktime_get_seconds(); in export_stats_init()
337 return percpu_counter_init_many(stats->counter, 0, GFP_KERNEL, in export_stats_init()
347 percpu_counter_set(&stats->counter[i], 0); in export_stats_reset()
354 percpu_counter_destroy_many(stats->counter, in export_stats_destroy()
361 path_put(&exp->ex_path); in svc_export_put()
362 auth_domain_put(exp->ex_client); in svc_export_put()
363 nfsd4_fslocs_free(&exp->ex_fslocs); in svc_export_put()
364 export_stats_destroy(exp->ex_stats); in svc_export_put()
365 kfree(exp->ex_stats); in svc_export_put()
366 kfree(exp->ex_uuid); in svc_export_put()
370 static int svc_export_upcall(struct cache_detail *cd, struct cache_head *h) in svc_export_upcall() argument
372 return sunrpc_cache_pipe_upcall(cd, h); in svc_export_upcall()
375 static void svc_export_request(struct cache_detail *cd, in svc_export_request() argument
383 qword_add(bpp, blen, exp->ex_client->name); in svc_export_request()
384 pth = d_path(&exp->ex_path, *bpp, *blen); in svc_export_request()
391 (*bpp)[-1] = '\n'; in svc_export_request()
400 struct inode *inode = d_inode(path->dentry); in check_export()
406 if (!S_ISDIR(inode->i_mode) && in check_export()
407 !S_ISLNK(inode->i_mode) && in check_export()
408 !S_ISREG(inode->i_mode)) in check_export()
409 return -ENOTDIR; in check_export()
421 * or an FSID number (so NFSEXP_FSID or ->uuid is needed). in check_export()
426 if (!(inode->i_sb->s_type->fs_flags & FS_REQUIRES_DEV) && in check_export()
429 dprintk("exp_export: export of non-dev fs without fsid\n"); in check_export()
430 return -EINVAL; in check_export()
433 if (!exportfs_can_decode_fh(inode->i_sb->s_export_op)) { in check_export()
435 return -EINVAL; in check_export()
438 if (is_idmapped_mnt(path->mnt)) { in check_export()
440 return -EINVAL; in check_export()
443 if (inode->i_sb->s_export_op->flags & EXPORT_OP_NOSUBTREECHK && in check_export()
446 __func__, inode->i_sb->s_type->name); in check_export()
447 return -EINVAL; in check_export()
461 if (fsloc->locations) in fsloc_parse()
462 return -EINVAL; in fsloc_parse()
465 err = get_uint(mesg, &fsloc->locations_count); in fsloc_parse()
468 if (fsloc->locations_count > MAX_FS_LOCATIONS) in fsloc_parse()
469 return -EINVAL; in fsloc_parse()
470 if (fsloc->locations_count == 0) in fsloc_parse()
473 fsloc->locations = kcalloc(fsloc->locations_count, in fsloc_parse()
476 if (!fsloc->locations) in fsloc_parse()
477 return -ENOMEM; in fsloc_parse()
478 for (i=0; i < fsloc->locations_count; i++) { in fsloc_parse()
480 err = -EINVAL; in fsloc_parse()
484 err = -ENOMEM; in fsloc_parse()
485 fsloc->locations[i].hosts = kstrdup(buf, GFP_KERNEL); in fsloc_parse()
486 if (!fsloc->locations[i].hosts) in fsloc_parse()
488 err = -EINVAL; in fsloc_parse()
493 err = -ENOMEM; in fsloc_parse()
494 fsloc->locations[i].path = kstrdup(buf, GFP_KERNEL); in fsloc_parse()
495 if (!fsloc->locations[i].path) in fsloc_parse()
502 err = -EINVAL; in fsloc_parse()
505 fsloc->migrated = migrated; in fsloc_parse()
519 if (exp->ex_nflavors) in secinfo_parse()
520 return -EINVAL; in secinfo_parse()
526 return -EINVAL; in secinfo_parse()
528 for (f = exp->ex_flavors; f < exp->ex_flavors + listsize; f++) { in secinfo_parse()
529 err = get_uint(mesg, &f->pseudoflavor); in secinfo_parse()
535 * problem at export time instead of when a client fails in secinfo_parse()
538 err = get_uint(mesg, &f->flags); in secinfo_parse()
542 if (~NFSEXP_SECINFO_FLAGS & (f->flags ^ exp->ex_flags)) in secinfo_parse()
543 return -EINVAL; in secinfo_parse()
545 exp->ex_nflavors = listsize; in secinfo_parse()
565 return -EINVAL; in xprtsec_parse()
567 exp->ex_xprtsec_modes = 0; in xprtsec_parse()
573 return -EINVAL; in xprtsec_parse()
574 exp->ex_xprtsec_modes |= mode; in xprtsec_parse()
586 return -EINVAL; in nfsd_uuid_parse()
591 return -EINVAL; in nfsd_uuid_parse()
595 return -ENOMEM; in nfsd_uuid_parse()
600 static int svc_export_parse(struct cache_detail *cd, char *mesg, int mlen) in svc_export_parse() argument
609 if (mesg[mlen-1] != '\n') in svc_export_parse()
610 return -EINVAL; in svc_export_parse()
611 mesg[mlen-1] = 0; in svc_export_parse()
615 return -ENOMEM; in svc_export_parse()
618 err = -EINVAL; in svc_export_parse()
622 err = -ENOENT; in svc_export_parse()
628 err = -EINVAL; in svc_export_parse()
637 exp.cd = cd; in svc_export_parse()
648 if (err == -ENOENT) { in svc_export_parse()
685 * following. Newer user-space can try to set in svc_export_parse()
706 * invalid (-1) uid & gid on the "dummy" export which it in svc_export_parse()
707 * uses to test export support. To make sure exportfs in svc_export_parse()
711 err = -EINVAL; in svc_export_parse()
723 err = -ENOMEM; in svc_export_parse()
732 err = -ENOMEM; in svc_export_parse()
756 return !strcmp(m->file->f_path.dentry->d_name.name, "export_stats"); in is_export_stats_file()
760 struct cache_detail *cd, in svc_export_show() argument
768 seq_puts(m, "#path domain start-time\n#\tstats\n"); in svc_export_show()
774 seq_path(m, &exp->ex_path, " \t\n\\"); in svc_export_show()
776 seq_escape(m, exp->ex_client->name, " \t\n\\"); in svc_export_show()
778 struct percpu_counter *counter = exp->ex_stats->counter; in svc_export_show()
780 seq_printf(m, "\t%lld\n", exp->ex_stats->start_time); in svc_export_show()
791 if (test_bit(CACHE_VALID, &h->flags) && in svc_export_show()
792 !test_bit(CACHE_NEGATIVE, &h->flags)) { in svc_export_show()
793 exp_flags(m, exp->ex_flags, exp->ex_fsid, in svc_export_show()
794 exp->ex_anon_uid, exp->ex_anon_gid, &exp->ex_fslocs); in svc_export_show()
795 if (exp->ex_uuid) { in svc_export_show()
801 seq_printf(m, "%02x", exp->ex_uuid[i]); in svc_export_show()
813 return orig->ex_client == new->ex_client && in svc_export_match()
814 path_equal(&orig->ex_path, &new->ex_path); in svc_export_match()
822 kref_get(&item->ex_client->ref); in svc_export_init()
823 new->ex_client = item->ex_client; in svc_export_init()
824 new->ex_path = item->ex_path; in svc_export_init()
825 path_get(&item->ex_path); in svc_export_init()
826 new->ex_fslocs.locations = NULL; in svc_export_init()
827 new->ex_fslocs.locations_count = 0; in svc_export_init()
828 new->ex_fslocs.migrated = 0; in svc_export_init()
829 new->ex_layout_types = 0; in svc_export_init()
830 new->ex_uuid = NULL; in svc_export_init()
831 new->cd = item->cd; in svc_export_init()
832 export_stats_reset(new->ex_stats); in svc_export_init()
841 new->ex_flags = item->ex_flags; in export_update()
842 new->ex_anon_uid = item->ex_anon_uid; in export_update()
843 new->ex_anon_gid = item->ex_anon_gid; in export_update()
844 new->ex_fsid = item->ex_fsid; in export_update()
845 new->ex_devid_map = item->ex_devid_map; in export_update()
846 item->ex_devid_map = NULL; in export_update()
847 new->ex_uuid = item->ex_uuid; in export_update()
848 item->ex_uuid = NULL; in export_update()
849 new->ex_fslocs.locations = item->ex_fslocs.locations; in export_update()
850 item->ex_fslocs.locations = NULL; in export_update()
851 new->ex_fslocs.locations_count = item->ex_fslocs.locations_count; in export_update()
852 item->ex_fslocs.locations_count = 0; in export_update()
853 new->ex_fslocs.migrated = item->ex_fslocs.migrated; in export_update()
854 item->ex_fslocs.migrated = 0; in export_update()
855 new->ex_layout_types = item->ex_layout_types; in export_update()
856 new->ex_nflavors = item->ex_nflavors; in export_update()
858 new->ex_flavors[i] = item->ex_flavors[i]; in export_update()
860 new->ex_xprtsec_modes = item->ex_xprtsec_modes; in export_update()
869 i->ex_stats = kmalloc(sizeof(*(i->ex_stats)), GFP_KERNEL); in svc_export_alloc()
870 if (!i->ex_stats) { in svc_export_alloc()
875 if (export_stats_init(i->ex_stats)) { in svc_export_alloc()
876 kfree(i->ex_stats); in svc_export_alloc()
881 return &i->h; in svc_export_alloc()
904 hash = hash_ptr(exp->ex_client, EXPORT_HASHBITS); in svc_export_hash()
905 hash ^= hash_ptr(exp->ex_path.dentry, EXPORT_HASHBITS); in svc_export_hash()
906 hash ^= hash_ptr(exp->ex_path.mnt, EXPORT_HASHBITS); in svc_export_hash()
916 ch = sunrpc_cache_lookup_rcu(exp->cd, &exp->h, hash); in svc_export_lookup()
929 ch = sunrpc_cache_update(old->cd, &new->h, &old->h, hash); in svc_export_update()
938 exp_find_key(struct cache_detail *cd, struct auth_domain *clp, int fsid_type, in exp_find_key() argument
945 return ERR_PTR(-ENOENT); in exp_find_key()
951 ek = svc_expkey_lookup(cd, &key); in exp_find_key()
953 return ERR_PTR(-ENOMEM); in exp_find_key()
954 err = cache_check(cd, &ek->h, reqp); in exp_find_key()
963 exp_get_by_name(struct cache_detail *cd, struct auth_domain *clp, in exp_get_by_name() argument
970 return ERR_PTR(-ENOENT); in exp_get_by_name()
974 key.cd = cd; in exp_get_by_name()
978 return ERR_PTR(-ENOMEM); in exp_get_by_name()
979 err = cache_check(cd, &exp->h, reqp); in exp_get_by_name()
991 exp_parent(struct cache_detail *cd, struct auth_domain *clp, struct path *path) in exp_parent() argument
993 struct dentry *saved = dget(path->dentry); in exp_parent()
994 struct svc_export *exp = exp_get_by_name(cd, clp, path, NULL); in exp_parent()
996 while (PTR_ERR(exp) == -ENOENT && !IS_ROOT(path->dentry)) { in exp_parent()
997 struct dentry *parent = dget_parent(path->dentry); in exp_parent()
998 dput(path->dentry); in exp_parent()
999 path->dentry = parent; in exp_parent()
1000 exp = exp_get_by_name(cd, clp, path, NULL); in exp_parent()
1002 dput(path->dentry); in exp_parent()
1003 path->dentry = saved; in exp_parent()
1024 struct cache_detail *cd = nn->svc_export_cache; in exp_rootfh() local
1026 err = -EPERM; in exp_rootfh()
1027 /* NB: we probably ought to check that it's NUL-terminated */ in exp_rootfh()
1035 name, path.dentry, clp->name, in exp_rootfh()
1036 inode->i_sb->s_id, inode->i_ino); in exp_rootfh()
1037 exp = exp_parent(cd, clp, &path); in exp_rootfh()
1048 err = -EINVAL; in exp_rootfh()
1059 static struct svc_export *exp_find(struct cache_detail *cd, in exp_find() argument
1064 struct nfsd_net *nn = net_generic(cd->net, nfsd_net_id); in exp_find()
1065 struct svc_expkey *ek = exp_find_key(nn->svc_expkey_cache, clp, fsid_type, fsidv, reqp); in exp_find()
1069 exp = exp_get_by_name(cd, clp, &ek->ek_path, reqp); in exp_find()
1070 cache_put(&ek->h, nn->svc_expkey_cache); in exp_find()
1078 * check_nfsd_access - check if access to export is allowed.
1088 struct exp_flavor_info *f, *end = exp->ex_flavors + exp->ex_nflavors; in check_nfsd_access()
1100 xprt = rqstp->rq_xprt; in check_nfsd_access()
1102 if (exp->ex_xprtsec_modes & NFSEXP_XPRTSEC_NONE) { in check_nfsd_access()
1103 if (!test_bit(XPT_TLS_SESSION, &xprt->xpt_flags)) in check_nfsd_access()
1106 if (exp->ex_xprtsec_modes & NFSEXP_XPRTSEC_TLS) { in check_nfsd_access()
1107 if (test_bit(XPT_TLS_SESSION, &xprt->xpt_flags) && in check_nfsd_access()
1108 !test_bit(XPT_PEER_AUTH, &xprt->xpt_flags)) in check_nfsd_access()
1111 if (exp->ex_xprtsec_modes & NFSEXP_XPRTSEC_MTLS) { in check_nfsd_access()
1112 if (test_bit(XPT_TLS_SESSION, &xprt->xpt_flags) && in check_nfsd_access()
1113 test_bit(XPT_PEER_AUTH, &xprt->xpt_flags)) in check_nfsd_access()
1119 /* legacy gss-only clients are always OK: */ in check_nfsd_access()
1120 if (exp->ex_client == rqstp->rq_gssclient) in check_nfsd_access()
1122 /* ip-address based client; check sec= export option: */ in check_nfsd_access()
1123 for (f = exp->ex_flavors; f < end; f++) { in check_nfsd_access()
1124 if (f->pseudoflavor == rqstp->rq_cred.cr_flavor) in check_nfsd_access()
1128 if (exp->ex_nflavors == 0) { in check_nfsd_access()
1129 if (rqstp->rq_cred.cr_flavor == RPC_AUTH_NULL || in check_nfsd_access()
1130 rqstp->rq_cred.cr_flavor == RPC_AUTH_UNIX) in check_nfsd_access()
1159 struct svc_export *gssexp, *exp = ERR_PTR(-ENOENT); in rqst_exp_get_by_name()
1161 struct cache_detail *cd = nn->svc_export_cache; in rqst_exp_get_by_name() local
1163 if (rqstp->rq_client == NULL) in rqst_exp_get_by_name()
1167 exp = exp_get_by_name(cd, rqstp->rq_client, path, &rqstp->rq_chandle); in rqst_exp_get_by_name()
1168 if (PTR_ERR(exp) == -ENOENT) in rqst_exp_get_by_name()
1173 if (exp->ex_nflavors > 0) in rqst_exp_get_by_name()
1177 if (rqstp->rq_gssclient == NULL) in rqst_exp_get_by_name()
1179 gssexp = exp_get_by_name(cd, rqstp->rq_gssclient, path, &rqstp->rq_chandle); in rqst_exp_get_by_name()
1180 if (PTR_ERR(gssexp) == -ENOENT) in rqst_exp_get_by_name()
1188 * rqst_exp_find - Find an svc_export in the context of a rqst or similar
1189 * @reqp: The handle to be used to suspend the request if a cache-upcall is needed
1190 * If NULL, missing in-cache information will result in failure.
1208 struct svc_export *gssexp, *exp = ERR_PTR(-ENOENT); in rqst_exp_find()
1209 struct cache_detail *cd = nn->svc_export_cache; in rqst_exp_find() local
1215 exp = exp_find(cd, cl, fsid_type, fsidv, reqp); in rqst_exp_find()
1216 if (PTR_ERR(exp) == -ENOENT) in rqst_exp_find()
1221 if (exp->ex_nflavors > 0) in rqst_exp_find()
1227 gssexp = exp_find(cd, gsscl, fsid_type, fsidv, reqp); in rqst_exp_find()
1228 if (PTR_ERR(gssexp) == -ENOENT) in rqst_exp_find()
1238 struct dentry *saved = dget(path->dentry); in rqst_exp_parent()
1241 while (PTR_ERR(exp) == -ENOENT && !IS_ROOT(path->dentry)) { in rqst_exp_parent()
1242 struct dentry *parent = dget_parent(path->dentry); in rqst_exp_parent()
1243 dput(path->dentry); in rqst_exp_parent()
1244 path->dentry = parent; in rqst_exp_parent()
1247 dput(path->dentry); in rqst_exp_parent()
1248 path->dentry = saved; in rqst_exp_parent()
1258 return rqst_exp_find(&rqstp->rq_chandle, SVC_NET(rqstp), in rqst_find_fsidzero_export()
1259 rqstp->rq_client, rqstp->rq_gssclient, in rqst_find_fsidzero_export()
1277 rv = fh_compose(fhp, exp, exp->ex_path.dentry, NULL); in exp_pseudoroot()
1308 for (flg = expflags; flg->flag; flg++) { in show_expflags()
1309 if (flg->flag & ~mask) in show_expflags()
1311 state = (flg->flag & flags) ? 0 : 1; in show_expflags()
1312 if (*flg->name[state]) in show_expflags()
1313 seq_printf(m, "%s%s", first++?",":"", flg->name[state]); in show_expflags()
1334 flags = (*fp)->flags; in show_secinfo_run()
1335 seq_printf(m, ",sec=%d", (*fp)->pseudoflavor); in show_secinfo_run()
1337 while (*fp != end && secinfo_flags_equal(flags, (*fp)->flags)) { in show_secinfo_run()
1338 seq_printf(m, ":%d", (*fp)->pseudoflavor); in show_secinfo_run()
1347 struct exp_flavor_info *end = exp->ex_flavors + exp->ex_nflavors; in show_secinfo()
1350 if (exp->ex_nflavors == 0) in show_secinfo()
1352 f = exp->ex_flavors; in show_secinfo()
1354 if (!secinfo_flags_equal(flags, exp->ex_flags)) in show_secinfo()
1365 struct user_namespace *userns = m->file->f_cred->user_ns; in exp_flags()
1370 if (!uid_eq(anonu, make_kuid(userns, (uid_t)-2)) && in exp_flags()
1371 !uid_eq(anonu, make_kuid(userns, 0x10000-2))) in exp_flags()
1373 if (!gid_eq(anong, make_kgid(userns, (gid_t)-2)) && in exp_flags()
1374 !gid_eq(anong, make_kgid(userns, 0x10000-2))) in exp_flags()
1376 if (fsloc && fsloc->locations_count > 0) { in exp_flags()
1377 char *loctype = (fsloc->migrated) ? "refer" : "replicas"; in exp_flags()
1381 seq_escape(m, fsloc->locations[0].path, ",;@ \t\n\\"); in exp_flags()
1383 seq_escape(m, fsloc->locations[0].hosts, ",;@ \t\n\\"); in exp_flags()
1384 for (i = 1; i < fsloc->locations_count; i++) { in exp_flags()
1386 seq_escape(m, fsloc->locations[i].path, ",;@ \t\n\\"); in exp_flags()
1388 seq_escape(m, fsloc->locations[i].hosts, ",;@ \t\n\\"); in exp_flags()
1397 struct cache_detail *cd = m->private; in e_show() local
1403 seq_puts(m, "# Path Client Start-time\n#\tStats\n"); in e_show()
1410 if (cache_check(cd, &exp->h, NULL)) in e_show()
1413 return svc_export_show(m, cd, cp); in e_show()
1432 dprintk("nfsd: initializing export module (net: %x).\n", net->ns.inum); in nfsd_export_init()
1434 nn->svc_export_cache = cache_create_net(&svc_export_cache_template, net); in nfsd_export_init()
1435 if (IS_ERR(nn->svc_export_cache)) in nfsd_export_init()
1436 return PTR_ERR(nn->svc_export_cache); in nfsd_export_init()
1437 rv = cache_register_net(nn->svc_export_cache, net); in nfsd_export_init()
1441 nn->svc_expkey_cache = cache_create_net(&svc_expkey_cache_template, net); in nfsd_export_init()
1442 if (IS_ERR(nn->svc_expkey_cache)) { in nfsd_export_init()
1443 rv = PTR_ERR(nn->svc_expkey_cache); in nfsd_export_init()
1446 rv = cache_register_net(nn->svc_expkey_cache, net); in nfsd_export_init()
1452 cache_destroy_net(nn->svc_expkey_cache, net); in nfsd_export_init()
1454 cache_unregister_net(nn->svc_export_cache, net); in nfsd_export_init()
1456 cache_destroy_net(nn->svc_export_cache, net); in nfsd_export_init()
1461 * Flush exports table - called when last nfsd thread is killed
1468 cache_purge(nn->svc_expkey_cache); in nfsd_export_flush()
1469 cache_purge(nn->svc_export_cache); in nfsd_export_flush()
1480 dprintk("nfsd: shutting down export module (net: %x).\n", net->ns.inum); in nfsd_export_shutdown()
1482 cache_unregister_net(nn->svc_expkey_cache, net); in nfsd_export_shutdown()
1483 cache_unregister_net(nn->svc_export_cache, net); in nfsd_export_shutdown()
1484 cache_destroy_net(nn->svc_expkey_cache, net); in nfsd_export_shutdown()
1485 cache_destroy_net(nn->svc_export_cache, net); in nfsd_export_shutdown()
1488 dprintk("nfsd: export shutdown complete (net: %x).\n", net->ns.inum); in nfsd_export_shutdown()