Lines Matching refs:exp
352 struct svc_export *exp = container_of(ref, struct svc_export, h.ref); in svc_export_put() local
353 path_put(&exp->ex_path); in svc_export_put()
354 auth_domain_put(exp->ex_client); in svc_export_put()
355 nfsd4_fslocs_free(&exp->ex_fslocs); in svc_export_put()
356 export_stats_destroy(&exp->ex_stats); in svc_export_put()
357 kfree(exp->ex_uuid); in svc_export_put()
358 kfree_rcu(exp, ex_rcu); in svc_export_put()
371 struct svc_export *exp = container_of(h, struct svc_export, h); in svc_export_request() local
374 qword_add(bpp, blen, exp->ex_client->name); in svc_export_request()
375 pth = d_path(&exp->ex_path, *bpp, *blen); in svc_export_request()
505 static int secinfo_parse(char **mesg, char *buf, struct svc_export *exp) in secinfo_parse() argument
512 if (exp->ex_nflavors) in secinfo_parse()
521 for (f = exp->ex_flavors; f < exp->ex_flavors + listsize; f++) { in secinfo_parse()
535 if (~NFSEXP_SECINFO_FLAGS & (f->flags ^ exp->ex_flags)) in secinfo_parse()
538 exp->ex_nflavors = listsize; in secinfo_parse()
546 secinfo_parse(char **mesg, char *buf, struct svc_export *exp) { return 0; } in secinfo_parse() argument
577 struct svc_export exp = {}, *expp; in svc_export_parse() local
604 err = kern_path(buf, 0, &exp.ex_path); in svc_export_parse()
608 exp.ex_client = dom; in svc_export_parse()
609 exp.cd = cd; in svc_export_parse()
610 exp.ex_devid_map = NULL; in svc_export_parse()
614 exp.h.expiry_time = get_expiry(&mesg); in svc_export_parse()
615 if (exp.h.expiry_time == 0) in svc_export_parse()
622 set_bit(CACHE_NEGATIVE, &exp.h.flags); in svc_export_parse()
626 exp.ex_flags= an_int; in svc_export_parse()
632 exp.ex_anon_uid= make_kuid(current_user_ns(), an_int); in svc_export_parse()
638 exp.ex_anon_gid= make_kgid(current_user_ns(), an_int); in svc_export_parse()
644 exp.ex_fsid = an_int; in svc_export_parse()
648 err = fsloc_parse(&mesg, buf, &exp.ex_fslocs); in svc_export_parse()
650 err = nfsd_uuid_parse(&mesg, buf, &exp.ex_uuid); in svc_export_parse()
652 err = secinfo_parse(&mesg, buf, &exp); in svc_export_parse()
663 err = check_export(&exp.ex_path, &exp.ex_flags, exp.ex_uuid); in svc_export_parse()
671 if (exp.h.expiry_time < seconds_since_boot()) in svc_export_parse()
681 if (!uid_valid(exp.ex_anon_uid)) in svc_export_parse()
683 if (!gid_valid(exp.ex_anon_gid)) in svc_export_parse()
687 nfsd4_setup_layout_type(&exp); in svc_export_parse()
690 expp = svc_export_lookup(&exp); in svc_export_parse()
695 expp = svc_export_update(&exp, expp); in svc_export_parse()
703 nfsd4_fslocs_free(&exp.ex_fslocs); in svc_export_parse()
704 kfree(exp.ex_uuid); in svc_export_parse()
706 path_put(&exp.ex_path); in svc_export_parse()
716 static void show_secinfo(struct seq_file *m, struct svc_export *exp);
732 struct svc_export *exp; in svc_export_show() local
742 exp = container_of(h, struct svc_export, h); in svc_export_show()
743 seq_path(m, &exp->ex_path, " \t\n\\"); in svc_export_show()
745 seq_escape(m, exp->ex_client->name, " \t\n\\"); in svc_export_show()
747 seq_printf(m, "\t%lld\n", exp->ex_stats.start_time); in svc_export_show()
749 percpu_counter_sum_positive(&exp->ex_stats.counter[EXP_STATS_FH_STALE])); in svc_export_show()
751 percpu_counter_sum_positive(&exp->ex_stats.counter[EXP_STATS_IO_READ])); in svc_export_show()
753 percpu_counter_sum_positive(&exp->ex_stats.counter[EXP_STATS_IO_WRITE])); in svc_export_show()
760 exp_flags(m, exp->ex_flags, exp->ex_fsid, in svc_export_show()
761 exp->ex_anon_uid, exp->ex_anon_gid, &exp->ex_fslocs); in svc_export_show()
762 if (exp->ex_uuid) { in svc_export_show()
768 seq_printf(m, "%02x", exp->ex_uuid[i]); in svc_export_show()
771 show_secinfo(m, exp); in svc_export_show()
859 svc_export_hash(struct svc_export *exp) in svc_export_hash() argument
863 hash = hash_ptr(exp->ex_client, EXPORT_HASHBITS); in svc_export_hash()
864 hash ^= hash_ptr(exp->ex_path.dentry, EXPORT_HASHBITS); in svc_export_hash()
865 hash ^= hash_ptr(exp->ex_path.mnt, EXPORT_HASHBITS); in svc_export_hash()
870 svc_export_lookup(struct svc_export *exp) in svc_export_lookup() argument
873 int hash = svc_export_hash(exp); in svc_export_lookup()
875 ch = sunrpc_cache_lookup_rcu(exp->cd, &exp->h, hash); in svc_export_lookup()
925 struct svc_export *exp, key; in exp_get_by_name() local
935 exp = svc_export_lookup(&key); in exp_get_by_name()
936 if (exp == NULL) in exp_get_by_name()
938 err = cache_check(cd, &exp->h, reqp); in exp_get_by_name()
943 return exp; in exp_get_by_name()
953 struct svc_export *exp = exp_get_by_name(cd, clp, path, NULL); in exp_parent() local
955 while (PTR_ERR(exp) == -ENOENT && !IS_ROOT(path->dentry)) { in exp_parent()
959 exp = exp_get_by_name(cd, clp, path, NULL); in exp_parent()
963 return exp; in exp_parent()
977 struct svc_export *exp; in exp_rootfh() local
996 exp = exp_parent(cd, clp, &path); in exp_rootfh()
997 if (IS_ERR(exp)) { in exp_rootfh()
998 err = PTR_ERR(exp); in exp_rootfh()
1006 if (fh_compose(&fh, exp, path.dentry, NULL)) in exp_rootfh()
1012 exp_put(exp); in exp_rootfh()
1022 struct svc_export *exp; in exp_find() local
1028 exp = exp_get_by_name(cd, clp, &ek->ek_path, reqp); in exp_find()
1031 if (IS_ERR(exp)) in exp_find()
1032 return ERR_CAST(exp); in exp_find()
1033 return exp; in exp_find()
1036 __be32 check_nfsd_access(struct svc_export *exp, struct svc_rqst *rqstp) in check_nfsd_access() argument
1039 struct exp_flavor_info *end = exp->ex_flavors + exp->ex_nflavors; in check_nfsd_access()
1042 if (exp->ex_client == rqstp->rq_gssclient) in check_nfsd_access()
1045 for (f = exp->ex_flavors; f < end; f++) { in check_nfsd_access()
1050 if (exp->ex_nflavors == 0) { in check_nfsd_access()
1080 struct svc_export *gssexp, *exp = ERR_PTR(-ENOENT); in rqst_exp_get_by_name() local
1088 exp = exp_get_by_name(cd, rqstp->rq_client, path, &rqstp->rq_chandle); in rqst_exp_get_by_name()
1089 if (PTR_ERR(exp) == -ENOENT) in rqst_exp_get_by_name()
1091 if (IS_ERR(exp)) in rqst_exp_get_by_name()
1092 return exp; in rqst_exp_get_by_name()
1094 if (exp->ex_nflavors > 0) in rqst_exp_get_by_name()
1095 return exp; in rqst_exp_get_by_name()
1099 return exp; in rqst_exp_get_by_name()
1102 return exp; in rqst_exp_get_by_name()
1103 if (!IS_ERR(exp)) in rqst_exp_get_by_name()
1104 exp_put(exp); in rqst_exp_get_by_name()
1111 struct svc_export *gssexp, *exp = ERR_PTR(-ENOENT); in rqst_exp_find() local
1119 exp = exp_find(cd, rqstp->rq_client, fsid_type, in rqst_exp_find()
1121 if (PTR_ERR(exp) == -ENOENT) in rqst_exp_find()
1123 if (IS_ERR(exp)) in rqst_exp_find()
1124 return exp; in rqst_exp_find()
1126 if (exp->ex_nflavors > 0) in rqst_exp_find()
1127 return exp; in rqst_exp_find()
1131 return exp; in rqst_exp_find()
1135 return exp; in rqst_exp_find()
1136 if (!IS_ERR(exp)) in rqst_exp_find()
1137 exp_put(exp); in rqst_exp_find()
1145 struct svc_export *exp = rqst_exp_get_by_name(rqstp, path); in rqst_exp_parent() local
1147 while (PTR_ERR(exp) == -ENOENT && !IS_ROOT(path->dentry)) { in rqst_exp_parent()
1151 exp = rqst_exp_get_by_name(rqstp, path); in rqst_exp_parent()
1155 return exp; in rqst_exp_parent()
1175 struct svc_export *exp; in exp_pseudoroot() local
1178 exp = rqst_find_fsidzero_export(rqstp); in exp_pseudoroot()
1179 if (IS_ERR(exp)) in exp_pseudoroot()
1180 return nfserrno(PTR_ERR(exp)); in exp_pseudoroot()
1181 rv = fh_compose(fhp, exp, exp->ex_path.dentry, NULL); in exp_pseudoroot()
1182 exp_put(exp); in exp_pseudoroot()
1248 static void show_secinfo(struct seq_file *m, struct svc_export *exp) in show_secinfo() argument
1251 struct exp_flavor_info *end = exp->ex_flavors + exp->ex_nflavors; in show_secinfo()
1254 if (exp->ex_nflavors == 0) in show_secinfo()
1256 f = exp->ex_flavors; in show_secinfo()
1258 if (!secinfo_flags_equal(flags, exp->ex_flags)) in show_secinfo()
1300 struct svc_export *exp = container_of(cp, struct svc_export, h); in e_show() local
1313 exp_get(exp); in e_show()
1314 if (cache_check(cd, &exp->h, NULL)) in e_show()
1316 exp_put(exp); in e_show()