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()
363 nfsd4_fslocs_free(&exp->ex_fslocs); in svc_export_release()
364 export_stats_destroy(exp->ex_stats); in svc_export_release()
365 kfree(exp->ex_stats); in svc_export_release()
366 kfree(exp->ex_uuid); in svc_export_release()
374 path_put(&exp->ex_path); in svc_export_put()
375 auth_domain_put(exp->ex_client); in svc_export_put()
376 call_rcu(&exp->ex_rcu, svc_export_release); in svc_export_put()
379 static int svc_export_upcall(struct cache_detail *cd, struct cache_head *h) in svc_export_upcall() argument
381 return sunrpc_cache_pipe_upcall(cd, h); in svc_export_upcall()
384 static void svc_export_request(struct cache_detail *cd, in svc_export_request() argument
392 qword_add(bpp, blen, exp->ex_client->name); in svc_export_request()
393 pth = d_path(&exp->ex_path, *bpp, *blen); in svc_export_request()
400 (*bpp)[-1] = '\n'; in svc_export_request()
409 struct inode *inode = d_inode(path->dentry); in check_export()
415 if (!S_ISDIR(inode->i_mode) && in check_export()
416 !S_ISLNK(inode->i_mode) && in check_export()
417 !S_ISREG(inode->i_mode)) in check_export()
418 return -ENOTDIR; in check_export()
430 * or an FSID number (so NFSEXP_FSID or ->uuid is needed). in check_export()
435 if (!(inode->i_sb->s_type->fs_flags & FS_REQUIRES_DEV) && in check_export()
438 dprintk("exp_export: export of non-dev fs without fsid\n"); in check_export()
439 return -EINVAL; in check_export()
442 if (!exportfs_can_decode_fh(inode->i_sb->s_export_op)) { in check_export()
444 return -EINVAL; in check_export()
447 if (is_idmapped_mnt(path->mnt)) { in check_export()
449 return -EINVAL; in check_export()
452 if (inode->i_sb->s_export_op->flags & EXPORT_OP_NOSUBTREECHK && in check_export()
455 __func__, inode->i_sb->s_type->name); in check_export()
456 return -EINVAL; in check_export()
470 if (fsloc->locations) in fsloc_parse()
471 return -EINVAL; in fsloc_parse()
474 err = get_uint(mesg, &fsloc->locations_count); in fsloc_parse()
477 if (fsloc->locations_count > MAX_FS_LOCATIONS) in fsloc_parse()
478 return -EINVAL; in fsloc_parse()
479 if (fsloc->locations_count == 0) in fsloc_parse()
482 fsloc->locations = kcalloc(fsloc->locations_count, in fsloc_parse()
485 if (!fsloc->locations) in fsloc_parse()
486 return -ENOMEM; in fsloc_parse()
487 for (i=0; i < fsloc->locations_count; i++) { in fsloc_parse()
489 err = -EINVAL; in fsloc_parse()
493 err = -ENOMEM; in fsloc_parse()
494 fsloc->locations[i].hosts = kstrdup(buf, GFP_KERNEL); in fsloc_parse()
495 if (!fsloc->locations[i].hosts) in fsloc_parse()
497 err = -EINVAL; in fsloc_parse()
502 err = -ENOMEM; in fsloc_parse()
503 fsloc->locations[i].path = kstrdup(buf, GFP_KERNEL); in fsloc_parse()
504 if (!fsloc->locations[i].path) in fsloc_parse()
511 err = -EINVAL; in fsloc_parse()
514 fsloc->migrated = migrated; in fsloc_parse()
528 if (exp->ex_nflavors) in secinfo_parse()
529 return -EINVAL; in secinfo_parse()
535 return -EINVAL; in secinfo_parse()
537 for (f = exp->ex_flavors; f < exp->ex_flavors + listsize; f++) { in secinfo_parse()
538 err = get_uint(mesg, &f->pseudoflavor); in secinfo_parse()
544 * problem at export time instead of when a client fails in secinfo_parse()
547 err = get_uint(mesg, &f->flags); in secinfo_parse()
551 if (~NFSEXP_SECINFO_FLAGS & (f->flags ^ exp->ex_flags)) in secinfo_parse()
552 return -EINVAL; in secinfo_parse()
554 exp->ex_nflavors = listsize; in secinfo_parse()
574 return -EINVAL; in xprtsec_parse()
576 exp->ex_xprtsec_modes = 0; in xprtsec_parse()
582 return -EINVAL; in xprtsec_parse()
583 exp->ex_xprtsec_modes |= mode; in xprtsec_parse()
595 return -EINVAL; in nfsd_uuid_parse()
600 return -EINVAL; in nfsd_uuid_parse()
604 return -ENOMEM; in nfsd_uuid_parse()
609 static int svc_export_parse(struct cache_detail *cd, char *mesg, int mlen) in svc_export_parse() argument
618 if (mesg[mlen-1] != '\n') in svc_export_parse()
619 return -EINVAL; in svc_export_parse()
620 mesg[mlen-1] = 0; in svc_export_parse()
624 return -ENOMEM; in svc_export_parse()
627 err = -EINVAL; in svc_export_parse()
631 err = -ENOENT; in svc_export_parse()
637 err = -EINVAL; in svc_export_parse()
646 exp.cd = cd; in svc_export_parse()
657 if (err == -ENOENT) { in svc_export_parse()
694 * following. Newer user-space can try to set in svc_export_parse()
715 * invalid (-1) uid & gid on the "dummy" export which it in svc_export_parse()
716 * uses to test export support. To make sure exportfs in svc_export_parse()
720 err = -EINVAL; in svc_export_parse()
732 err = -ENOMEM; in svc_export_parse()
741 err = -ENOMEM; in svc_export_parse()
765 return !strcmp(m->file->f_path.dentry->d_name.name, "export_stats"); in is_export_stats_file()
769 struct cache_detail *cd, in svc_export_show() argument
777 seq_puts(m, "#path domain start-time\n#\tstats\n"); in svc_export_show()
783 seq_path(m, &exp->ex_path, " \t\n\\"); in svc_export_show()
785 seq_escape(m, exp->ex_client->name, " \t\n\\"); in svc_export_show()
787 struct percpu_counter *counter = exp->ex_stats->counter; in svc_export_show()
789 seq_printf(m, "\t%lld\n", exp->ex_stats->start_time); in svc_export_show()
800 if (test_bit(CACHE_VALID, &h->flags) && in svc_export_show()
801 !test_bit(CACHE_NEGATIVE, &h->flags)) { in svc_export_show()
802 exp_flags(m, exp->ex_flags, exp->ex_fsid, in svc_export_show()
803 exp->ex_anon_uid, exp->ex_anon_gid, &exp->ex_fslocs); in svc_export_show()
804 if (exp->ex_uuid) { in svc_export_show()
810 seq_printf(m, "%02x", exp->ex_uuid[i]); in svc_export_show()
822 return orig->ex_client == new->ex_client && in svc_export_match()
823 path_equal(&orig->ex_path, &new->ex_path); in svc_export_match()
831 kref_get(&item->ex_client->ref); in svc_export_init()
832 new->ex_client = item->ex_client; in svc_export_init()
833 new->ex_path = item->ex_path; in svc_export_init()
834 path_get(&item->ex_path); in svc_export_init()
835 new->ex_fslocs.locations = NULL; in svc_export_init()
836 new->ex_fslocs.locations_count = 0; in svc_export_init()
837 new->ex_fslocs.migrated = 0; in svc_export_init()
838 new->ex_layout_types = 0; in svc_export_init()
839 new->ex_uuid = NULL; in svc_export_init()
840 new->cd = item->cd; in svc_export_init()
841 export_stats_reset(new->ex_stats); in svc_export_init()
850 new->ex_flags = item->ex_flags; in export_update()
851 new->ex_anon_uid = item->ex_anon_uid; in export_update()
852 new->ex_anon_gid = item->ex_anon_gid; in export_update()
853 new->ex_fsid = item->ex_fsid; in export_update()
854 new->ex_devid_map = item->ex_devid_map; in export_update()
855 item->ex_devid_map = NULL; in export_update()
856 new->ex_uuid = item->ex_uuid; in export_update()
857 item->ex_uuid = NULL; in export_update()
858 new->ex_fslocs.locations = item->ex_fslocs.locations; in export_update()
859 item->ex_fslocs.locations = NULL; in export_update()
860 new->ex_fslocs.locations_count = item->ex_fslocs.locations_count; in export_update()
861 item->ex_fslocs.locations_count = 0; in export_update()
862 new->ex_fslocs.migrated = item->ex_fslocs.migrated; in export_update()
863 item->ex_fslocs.migrated = 0; in export_update()
864 new->ex_layout_types = item->ex_layout_types; in export_update()
865 new->ex_nflavors = item->ex_nflavors; in export_update()
867 new->ex_flavors[i] = item->ex_flavors[i]; in export_update()
869 new->ex_xprtsec_modes = item->ex_xprtsec_modes; in export_update()
878 i->ex_stats = kmalloc(sizeof(*(i->ex_stats)), GFP_KERNEL); in svc_export_alloc()
879 if (!i->ex_stats) { in svc_export_alloc()
884 if (export_stats_init(i->ex_stats)) { in svc_export_alloc()
885 kfree(i->ex_stats); in svc_export_alloc()
890 return &i->h; in svc_export_alloc()
913 hash = hash_ptr(exp->ex_client, EXPORT_HASHBITS); in svc_export_hash()
914 hash ^= hash_ptr(exp->ex_path.dentry, EXPORT_HASHBITS); in svc_export_hash()
915 hash ^= hash_ptr(exp->ex_path.mnt, EXPORT_HASHBITS); in svc_export_hash()
925 ch = sunrpc_cache_lookup_rcu(exp->cd, &exp->h, hash); in svc_export_lookup()
938 ch = sunrpc_cache_update(old->cd, &new->h, &old->h, hash); in svc_export_update()
947 exp_find_key(struct cache_detail *cd, struct auth_domain *clp, int fsid_type, in exp_find_key() argument
954 return ERR_PTR(-ENOENT); in exp_find_key()
960 ek = svc_expkey_lookup(cd, &key); in exp_find_key()
962 return ERR_PTR(-ENOMEM); in exp_find_key()
963 err = cache_check(cd, &ek->h, reqp); in exp_find_key()
972 exp_get_by_name(struct cache_detail *cd, struct auth_domain *clp, in exp_get_by_name() argument
979 return ERR_PTR(-ENOENT); in exp_get_by_name()
983 key.cd = cd; in exp_get_by_name()
987 return ERR_PTR(-ENOMEM); in exp_get_by_name()
988 err = cache_check(cd, &exp->h, reqp); in exp_get_by_name()
1000 exp_parent(struct cache_detail *cd, struct auth_domain *clp, struct path *path) in exp_parent() argument
1002 struct dentry *saved = dget(path->dentry); in exp_parent()
1003 struct svc_export *exp = exp_get_by_name(cd, clp, path, NULL); in exp_parent()
1005 while (PTR_ERR(exp) == -ENOENT && !IS_ROOT(path->dentry)) { in exp_parent()
1006 struct dentry *parent = dget_parent(path->dentry); in exp_parent()
1007 dput(path->dentry); in exp_parent()
1008 path->dentry = parent; in exp_parent()
1009 exp = exp_get_by_name(cd, clp, path, NULL); in exp_parent()
1011 dput(path->dentry); in exp_parent()
1012 path->dentry = saved; in exp_parent()
1033 struct cache_detail *cd = nn->svc_export_cache; in exp_rootfh() local
1035 err = -EPERM; in exp_rootfh()
1036 /* NB: we probably ought to check that it's NUL-terminated */ in exp_rootfh()
1044 name, path.dentry, clp->name, in exp_rootfh()
1045 inode->i_sb->s_id, inode->i_ino); in exp_rootfh()
1046 exp = exp_parent(cd, clp, &path); in exp_rootfh()
1057 err = -EINVAL; in exp_rootfh()
1068 static struct svc_export *exp_find(struct cache_detail *cd, in exp_find() argument
1073 struct nfsd_net *nn = net_generic(cd->net, nfsd_net_id); in exp_find()
1074 struct svc_expkey *ek = exp_find_key(nn->svc_expkey_cache, clp, fsid_type, fsidv, reqp); in exp_find()
1078 exp = exp_get_by_name(cd, clp, &ek->ek_path, reqp); in exp_find()
1079 cache_put(&ek->h, nn->svc_expkey_cache); in exp_find()
1087 * check_nfsd_access - check if access to export is allowed.
1099 struct exp_flavor_info *f, *end = exp->ex_flavors + exp->ex_nflavors; in check_nfsd_access()
1111 xprt = rqstp->rq_xprt; in check_nfsd_access()
1113 if (exp->ex_xprtsec_modes & NFSEXP_XPRTSEC_NONE) { in check_nfsd_access()
1114 if (!test_bit(XPT_TLS_SESSION, &xprt->xpt_flags)) in check_nfsd_access()
1117 if (exp->ex_xprtsec_modes & NFSEXP_XPRTSEC_TLS) { in check_nfsd_access()
1118 if (test_bit(XPT_TLS_SESSION, &xprt->xpt_flags) && in check_nfsd_access()
1119 !test_bit(XPT_PEER_AUTH, &xprt->xpt_flags)) in check_nfsd_access()
1122 if (exp->ex_xprtsec_modes & NFSEXP_XPRTSEC_MTLS) { in check_nfsd_access()
1123 if (test_bit(XPT_TLS_SESSION, &xprt->xpt_flags) && in check_nfsd_access()
1124 test_bit(XPT_PEER_AUTH, &xprt->xpt_flags)) in check_nfsd_access()
1130 /* legacy gss-only clients are always OK: */ in check_nfsd_access()
1131 if (exp->ex_client == rqstp->rq_gssclient) in check_nfsd_access()
1133 /* ip-address based client; check sec= export option: */ in check_nfsd_access()
1134 for (f = exp->ex_flavors; f < end; f++) { in check_nfsd_access()
1135 if (f->pseudoflavor == rqstp->rq_cred.cr_flavor) in check_nfsd_access()
1139 if (exp->ex_nflavors == 0) { in check_nfsd_access()
1140 if (rqstp->rq_cred.cr_flavor == RPC_AUTH_NULL || in check_nfsd_access()
1141 rqstp->rq_cred.cr_flavor == RPC_AUTH_UNIX) in check_nfsd_access()
1154 /* Some calls may be processed without authentication in check_nfsd_access()
1160 * without authentication (none or sys). in check_nfsd_access()
1163 rqstp->rq_cred.cr_flavor == RPC_AUTH_NULL || in check_nfsd_access()
1164 rqstp->rq_cred.cr_flavor == RPC_AUTH_UNIX)) { in check_nfsd_access()
1165 for (f = exp->ex_flavors; f < end; f++) { in check_nfsd_access()
1166 if (f->pseudoflavor >= RPC_AUTH_DES) in check_nfsd_access()
1187 struct svc_export *gssexp, *exp = ERR_PTR(-ENOENT); in rqst_exp_get_by_name()
1189 struct cache_detail *cd = nn->svc_export_cache; in rqst_exp_get_by_name() local
1191 if (rqstp->rq_client == NULL) in rqst_exp_get_by_name()
1195 exp = exp_get_by_name(cd, rqstp->rq_client, path, &rqstp->rq_chandle); in rqst_exp_get_by_name()
1196 if (PTR_ERR(exp) == -ENOENT) in rqst_exp_get_by_name()
1201 if (exp->ex_nflavors > 0) in rqst_exp_get_by_name()
1205 if (rqstp->rq_gssclient == NULL) in rqst_exp_get_by_name()
1207 gssexp = exp_get_by_name(cd, rqstp->rq_gssclient, path, &rqstp->rq_chandle); in rqst_exp_get_by_name()
1208 if (PTR_ERR(gssexp) == -ENOENT) in rqst_exp_get_by_name()
1216 * rqst_exp_find - Find an svc_export in the context of a rqst or similar
1217 * @reqp: The handle to be used to suspend the request if a cache-upcall is needed
1218 * If NULL, missing in-cache information will result in failure.
1236 struct svc_export *gssexp, *exp = ERR_PTR(-ENOENT); in rqst_exp_find()
1237 struct cache_detail *cd = nn->svc_export_cache; in rqst_exp_find() local
1243 exp = exp_find(cd, cl, fsid_type, fsidv, reqp); in rqst_exp_find()
1244 if (PTR_ERR(exp) == -ENOENT) in rqst_exp_find()
1249 if (exp->ex_nflavors > 0) in rqst_exp_find()
1255 gssexp = exp_find(cd, gsscl, fsid_type, fsidv, reqp); in rqst_exp_find()
1256 if (PTR_ERR(gssexp) == -ENOENT) in rqst_exp_find()
1266 struct dentry *saved = dget(path->dentry); in rqst_exp_parent()
1269 while (PTR_ERR(exp) == -ENOENT && !IS_ROOT(path->dentry)) { in rqst_exp_parent()
1270 struct dentry *parent = dget_parent(path->dentry); in rqst_exp_parent()
1271 dput(path->dentry); in rqst_exp_parent()
1272 path->dentry = parent; in rqst_exp_parent()
1275 dput(path->dentry); in rqst_exp_parent()
1276 path->dentry = saved; in rqst_exp_parent()
1286 return rqst_exp_find(&rqstp->rq_chandle, SVC_NET(rqstp), in rqst_find_fsidzero_export()
1287 rqstp->rq_client, rqstp->rq_gssclient, in rqst_find_fsidzero_export()
1305 rv = fh_compose(fhp, exp, exp->ex_path.dentry, NULL); in exp_pseudoroot()
1336 for (flg = expflags; flg->flag; flg++) { in show_expflags()
1337 if (flg->flag & ~mask) in show_expflags()
1339 state = (flg->flag & flags) ? 0 : 1; in show_expflags()
1340 if (*flg->name[state]) in show_expflags()
1341 seq_printf(m, "%s%s", first++?",":"", flg->name[state]); in show_expflags()
1362 flags = (*fp)->flags; in show_secinfo_run()
1363 seq_printf(m, ",sec=%d", (*fp)->pseudoflavor); in show_secinfo_run()
1365 while (*fp != end && secinfo_flags_equal(flags, (*fp)->flags)) { in show_secinfo_run()
1366 seq_printf(m, ":%d", (*fp)->pseudoflavor); in show_secinfo_run()
1375 struct exp_flavor_info *end = exp->ex_flavors + exp->ex_nflavors; in show_secinfo()
1378 if (exp->ex_nflavors == 0) in show_secinfo()
1380 f = exp->ex_flavors; in show_secinfo()
1382 if (!secinfo_flags_equal(flags, exp->ex_flags)) in show_secinfo()
1393 struct user_namespace *userns = m->file->f_cred->user_ns; in exp_flags()
1398 if (!uid_eq(anonu, make_kuid(userns, (uid_t)-2)) && in exp_flags()
1399 !uid_eq(anonu, make_kuid(userns, 0x10000-2))) in exp_flags()
1401 if (!gid_eq(anong, make_kgid(userns, (gid_t)-2)) && in exp_flags()
1402 !gid_eq(anong, make_kgid(userns, 0x10000-2))) in exp_flags()
1404 if (fsloc && fsloc->locations_count > 0) { in exp_flags()
1405 char *loctype = (fsloc->migrated) ? "refer" : "replicas"; in exp_flags()
1409 seq_escape(m, fsloc->locations[0].path, ",;@ \t\n\\"); in exp_flags()
1411 seq_escape(m, fsloc->locations[0].hosts, ",;@ \t\n\\"); in exp_flags()
1412 for (i = 1; i < fsloc->locations_count; i++) { in exp_flags()
1414 seq_escape(m, fsloc->locations[i].path, ",;@ \t\n\\"); in exp_flags()
1416 seq_escape(m, fsloc->locations[i].hosts, ",;@ \t\n\\"); in exp_flags()
1425 struct cache_detail *cd = m->private; in e_show() local
1431 seq_puts(m, "# Path Client Start-time\n#\tStats\n"); in e_show()
1437 if (cache_check_rcu(cd, &exp->h, NULL)) in e_show()
1440 return svc_export_show(m, cd, cp); in e_show()
1459 dprintk("nfsd: initializing export module (net: %x).\n", net->ns.inum); in nfsd_export_init()
1461 nn->svc_export_cache = cache_create_net(&svc_export_cache_template, net); in nfsd_export_init()
1462 if (IS_ERR(nn->svc_export_cache)) in nfsd_export_init()
1463 return PTR_ERR(nn->svc_export_cache); in nfsd_export_init()
1464 rv = cache_register_net(nn->svc_export_cache, net); in nfsd_export_init()
1468 nn->svc_expkey_cache = cache_create_net(&svc_expkey_cache_template, net); in nfsd_export_init()
1469 if (IS_ERR(nn->svc_expkey_cache)) { in nfsd_export_init()
1470 rv = PTR_ERR(nn->svc_expkey_cache); in nfsd_export_init()
1473 rv = cache_register_net(nn->svc_expkey_cache, net); in nfsd_export_init()
1479 cache_destroy_net(nn->svc_expkey_cache, net); in nfsd_export_init()
1481 cache_unregister_net(nn->svc_export_cache, net); in nfsd_export_init()
1483 cache_destroy_net(nn->svc_export_cache, net); in nfsd_export_init()
1488 * Flush exports table - called when last nfsd thread is killed
1495 cache_purge(nn->svc_expkey_cache); in nfsd_export_flush()
1496 cache_purge(nn->svc_export_cache); in nfsd_export_flush()
1507 dprintk("nfsd: shutting down export module (net: %x).\n", net->ns.inum); in nfsd_export_shutdown()
1509 cache_unregister_net(nn->svc_expkey_cache, net); in nfsd_export_shutdown()
1510 cache_unregister_net(nn->svc_export_cache, net); in nfsd_export_shutdown()
1511 cache_destroy_net(nn->svc_expkey_cache, net); in nfsd_export_shutdown()
1512 cache_destroy_net(nn->svc_export_cache, net); in nfsd_export_shutdown()
1515 dprintk("nfsd: export shutdown complete (net: %x).\n", net->ns.inum); in nfsd_export_shutdown()