Lines Matching refs:exp
360 struct svc_export *exp = container_of(ref, struct svc_export, h.ref); in svc_export_put() local
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()
367 kfree_rcu(exp, ex_rcu); in svc_export_put()
380 struct svc_export *exp = container_of(h, struct svc_export, h); in svc_export_request() local
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()
512 static int secinfo_parse(char **mesg, char *buf, struct svc_export *exp) in secinfo_parse() argument
519 if (exp->ex_nflavors) in secinfo_parse()
528 for (f = exp->ex_flavors; f < exp->ex_flavors + listsize; f++) { in secinfo_parse()
542 if (~NFSEXP_SECINFO_FLAGS & (f->flags ^ exp->ex_flags)) in secinfo_parse()
545 exp->ex_nflavors = listsize; in secinfo_parse()
553 secinfo_parse(char **mesg, char *buf, struct svc_export *exp) { return 0; } in secinfo_parse() argument
556 static int xprtsec_parse(char **mesg, char *buf, struct svc_export *exp) in xprtsec_parse() argument
567 exp->ex_xprtsec_modes = 0; in xprtsec_parse()
574 exp->ex_xprtsec_modes |= mode; in xprtsec_parse()
606 struct svc_export exp = {}, *expp; in svc_export_parse() local
632 err = kern_path(buf, 0, &exp.ex_path); in svc_export_parse()
636 exp.ex_client = dom; in svc_export_parse()
637 exp.cd = cd; in svc_export_parse()
638 exp.ex_devid_map = NULL; in svc_export_parse()
639 exp.ex_xprtsec_modes = NFSEXP_XPRTSEC_ALL; in svc_export_parse()
642 err = get_expiry(&mesg, &exp.h.expiry_time); in svc_export_parse()
650 set_bit(CACHE_NEGATIVE, &exp.h.flags); in svc_export_parse()
654 exp.ex_flags= an_int; in svc_export_parse()
660 exp.ex_anon_uid= make_kuid(current_user_ns(), an_int); in svc_export_parse()
666 exp.ex_anon_gid= make_kgid(current_user_ns(), an_int); in svc_export_parse()
672 exp.ex_fsid = an_int; in svc_export_parse()
676 err = fsloc_parse(&mesg, buf, &exp.ex_fslocs); in svc_export_parse()
678 err = nfsd_uuid_parse(&mesg, buf, &exp.ex_uuid); in svc_export_parse()
680 err = secinfo_parse(&mesg, buf, &exp); in svc_export_parse()
682 err = xprtsec_parse(&mesg, buf, &exp); in svc_export_parse()
693 err = check_export(&exp.ex_path, &exp.ex_flags, exp.ex_uuid); in svc_export_parse()
702 if (exp.h.expiry_time < seconds_since_boot()) in svc_export_parse()
712 if (!uid_valid(exp.ex_anon_uid)) in svc_export_parse()
714 if (!gid_valid(exp.ex_anon_gid)) in svc_export_parse()
718 nfsd4_setup_layout_type(&exp); in svc_export_parse()
721 expp = svc_export_lookup(&exp); in svc_export_parse()
726 expp = svc_export_update(&exp, expp); in svc_export_parse()
734 nfsd4_fslocs_free(&exp.ex_fslocs); in svc_export_parse()
735 kfree(exp.ex_uuid); in svc_export_parse()
737 path_put(&exp.ex_path); in svc_export_parse()
747 static void show_secinfo(struct seq_file *m, struct svc_export *exp);
763 struct svc_export *exp; in svc_export_show() local
773 exp = container_of(h, struct svc_export, h); 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()
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()
804 show_secinfo(m, exp); in svc_export_show()
900 svc_export_hash(struct svc_export *exp) in svc_export_hash() argument
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()
911 svc_export_lookup(struct svc_export *exp) in svc_export_lookup() argument
914 int hash = svc_export_hash(exp); in svc_export_lookup()
916 ch = sunrpc_cache_lookup_rcu(exp->cd, &exp->h, hash); in svc_export_lookup()
966 struct svc_export *exp, key; in exp_get_by_name() local
976 exp = svc_export_lookup(&key); in exp_get_by_name()
977 if (exp == NULL) in exp_get_by_name()
979 err = cache_check(cd, &exp->h, reqp); in exp_get_by_name()
984 return exp; in exp_get_by_name()
994 struct svc_export *exp = exp_get_by_name(cd, clp, path, NULL); in exp_parent() local
996 while (PTR_ERR(exp) == -ENOENT && !IS_ROOT(path->dentry)) { in exp_parent()
1000 exp = exp_get_by_name(cd, clp, path, NULL); in exp_parent()
1004 return exp; in exp_parent()
1018 struct svc_export *exp; in exp_rootfh() local
1037 exp = exp_parent(cd, clp, &path); in exp_rootfh()
1038 if (IS_ERR(exp)) { in exp_rootfh()
1039 err = PTR_ERR(exp); in exp_rootfh()
1047 if (fh_compose(&fh, exp, path.dentry, NULL)) in exp_rootfh()
1053 exp_put(exp); in exp_rootfh()
1063 struct svc_export *exp; in exp_find() local
1069 exp = exp_get_by_name(cd, clp, &ek->ek_path, reqp); in exp_find()
1072 if (IS_ERR(exp)) in exp_find()
1073 return ERR_CAST(exp); in exp_find()
1074 return exp; in exp_find()
1086 __be32 check_nfsd_access(struct svc_export *exp, struct svc_rqst *rqstp) in check_nfsd_access() argument
1088 struct exp_flavor_info *f, *end = exp->ex_flavors + exp->ex_nflavors; in check_nfsd_access()
1102 if (exp->ex_xprtsec_modes & NFSEXP_XPRTSEC_NONE) { in check_nfsd_access()
1106 if (exp->ex_xprtsec_modes & NFSEXP_XPRTSEC_TLS) { in check_nfsd_access()
1111 if (exp->ex_xprtsec_modes & NFSEXP_XPRTSEC_MTLS) { in check_nfsd_access()
1120 if (exp->ex_client == rqstp->rq_gssclient) in check_nfsd_access()
1123 for (f = exp->ex_flavors; f < end; f++) { in check_nfsd_access()
1128 if (exp->ex_nflavors == 0) { in check_nfsd_access()
1159 struct svc_export *gssexp, *exp = ERR_PTR(-ENOENT); in rqst_exp_get_by_name() local
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()
1170 if (IS_ERR(exp)) in rqst_exp_get_by_name()
1171 return exp; in rqst_exp_get_by_name()
1173 if (exp->ex_nflavors > 0) in rqst_exp_get_by_name()
1174 return exp; in rqst_exp_get_by_name()
1178 return exp; in rqst_exp_get_by_name()
1181 return exp; in rqst_exp_get_by_name()
1182 if (!IS_ERR(exp)) in rqst_exp_get_by_name()
1183 exp_put(exp); in rqst_exp_get_by_name()
1208 struct svc_export *gssexp, *exp = ERR_PTR(-ENOENT); 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()
1218 if (IS_ERR(exp)) in rqst_exp_find()
1219 return exp; in rqst_exp_find()
1221 if (exp->ex_nflavors > 0) in rqst_exp_find()
1222 return exp; in rqst_exp_find()
1226 return exp; in rqst_exp_find()
1229 return exp; in rqst_exp_find()
1230 if (!IS_ERR(exp)) in rqst_exp_find()
1231 exp_put(exp); in rqst_exp_find()
1239 struct svc_export *exp = rqst_exp_get_by_name(rqstp, path); in rqst_exp_parent() local
1241 while (PTR_ERR(exp) == -ENOENT && !IS_ROOT(path->dentry)) { in rqst_exp_parent()
1245 exp = rqst_exp_get_by_name(rqstp, path); in rqst_exp_parent()
1249 return exp; in rqst_exp_parent()
1271 struct svc_export *exp; in exp_pseudoroot() local
1274 exp = rqst_find_fsidzero_export(rqstp); in exp_pseudoroot()
1275 if (IS_ERR(exp)) in exp_pseudoroot()
1276 return nfserrno(PTR_ERR(exp)); in exp_pseudoroot()
1277 rv = fh_compose(fhp, exp, exp->ex_path.dentry, NULL); in exp_pseudoroot()
1278 exp_put(exp); in exp_pseudoroot()
1344 static void show_secinfo(struct seq_file *m, struct svc_export *exp) in show_secinfo() argument
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()
1396 struct svc_export *exp = container_of(cp, struct svc_export, h); in e_show() local
1409 exp_get(exp); in e_show()
1410 if (cache_check(cd, &exp->h, NULL)) in e_show()
1412 exp_put(exp); in e_show()