Lines Matching refs:exp
311 struct svc_export *exp = container_of(ref, struct svc_export, h.ref); in svc_export_put() local
312 path_put(&exp->ex_path); in svc_export_put()
313 auth_domain_put(exp->ex_client); in svc_export_put()
314 nfsd4_fslocs_free(&exp->ex_fslocs); in svc_export_put()
315 kfree(exp->ex_uuid); in svc_export_put()
316 kfree(exp); in svc_export_put()
324 struct svc_export *exp = container_of(h, struct svc_export, h); in svc_export_request() local
327 qword_add(bpp, blen, exp->ex_client->name); in svc_export_request()
328 pth = d_path(&exp->ex_path, *bpp, *blen); in svc_export_request()
444 static int secinfo_parse(char **mesg, char *buf, struct svc_export *exp) in secinfo_parse() argument
451 if (exp->ex_nflavors) in secinfo_parse()
460 for (f = exp->ex_flavors; f < exp->ex_flavors + listsize; f++) { in secinfo_parse()
474 if (~NFSEXP_SECINFO_FLAGS & (f->flags ^ exp->ex_flags)) in secinfo_parse()
477 exp->ex_nflavors = listsize; in secinfo_parse()
485 secinfo_parse(char **mesg, char *buf, struct svc_export *exp) { return 0; } in secinfo_parse() argument
516 struct svc_export exp = {}, *expp; in svc_export_parse() local
543 err = kern_path(buf, 0, &exp.ex_path); in svc_export_parse()
547 exp.ex_client = dom; in svc_export_parse()
548 exp.cd = cd; in svc_export_parse()
549 exp.ex_devid_map = NULL; in svc_export_parse()
553 exp.h.expiry_time = get_expiry(&mesg); in svc_export_parse()
554 if (exp.h.expiry_time == 0) in svc_export_parse()
561 set_bit(CACHE_NEGATIVE, &exp.h.flags); in svc_export_parse()
565 exp.ex_flags= an_int; in svc_export_parse()
571 exp.ex_anon_uid= make_kuid(&init_user_ns, an_int); in svc_export_parse()
577 exp.ex_anon_gid= make_kgid(&init_user_ns, an_int); in svc_export_parse()
583 exp.ex_fsid = an_int; in svc_export_parse()
587 err = fsloc_parse(&mesg, buf, &exp.ex_fslocs); in svc_export_parse()
589 err = uuid_parse(&mesg, buf, &exp.ex_uuid); in svc_export_parse()
591 err = secinfo_parse(&mesg, buf, &exp); in svc_export_parse()
602 err = check_export(d_inode(exp.ex_path.dentry), &exp.ex_flags, in svc_export_parse()
603 exp.ex_uuid); in svc_export_parse()
611 if (exp.h.expiry_time < seconds_since_boot()) in svc_export_parse()
621 if (!uid_valid(exp.ex_anon_uid)) in svc_export_parse()
623 if (!gid_valid(exp.ex_anon_gid)) in svc_export_parse()
627 nfsd4_setup_layout_type(&exp); in svc_export_parse()
630 expp = svc_export_lookup(&exp); in svc_export_parse()
632 expp = svc_export_update(&exp, expp); in svc_export_parse()
641 nfsd4_fslocs_free(&exp.ex_fslocs); in svc_export_parse()
642 kfree(exp.ex_uuid); in svc_export_parse()
644 path_put(&exp.ex_path); in svc_export_parse()
654 static void show_secinfo(struct seq_file *m, struct svc_export *exp);
660 struct svc_export *exp ; in svc_export_show() local
666 exp = container_of(h, struct svc_export, h); in svc_export_show()
667 seq_path(m, &exp->ex_path, " \t\n\\"); in svc_export_show()
669 seq_escape(m, exp->ex_client->name, " \t\n\\"); in svc_export_show()
673 exp_flags(m, exp->ex_flags, exp->ex_fsid, in svc_export_show()
674 exp->ex_anon_uid, exp->ex_anon_gid, &exp->ex_fslocs); in svc_export_show()
675 if (exp->ex_uuid) { in svc_export_show()
681 seq_printf(m, "%02x", exp->ex_uuid[i]); in svc_export_show()
684 show_secinfo(m, exp); in svc_export_show()
765 svc_export_hash(struct svc_export *exp) in svc_export_hash() argument
769 hash = hash_ptr(exp->ex_client, EXPORT_HASHBITS); in svc_export_hash()
770 hash ^= hash_ptr(exp->ex_path.dentry, EXPORT_HASHBITS); in svc_export_hash()
771 hash ^= hash_ptr(exp->ex_path.mnt, EXPORT_HASHBITS); in svc_export_hash()
776 svc_export_lookup(struct svc_export *exp) in svc_export_lookup() argument
779 int hash = svc_export_hash(exp); in svc_export_lookup()
781 ch = sunrpc_cache_lookup(exp->cd, &exp->h, hash); in svc_export_lookup()
829 struct svc_export *exp, key; in exp_get_by_name() local
839 exp = svc_export_lookup(&key); in exp_get_by_name()
840 if (exp == NULL) in exp_get_by_name()
842 err = cache_check(cd, &exp->h, reqp); in exp_get_by_name()
845 return exp; in exp_get_by_name()
855 struct svc_export *exp = exp_get_by_name(cd, clp, path, NULL); in exp_parent() local
857 while (PTR_ERR(exp) == -ENOENT && !IS_ROOT(path->dentry)) { in exp_parent()
861 exp = exp_get_by_name(cd, clp, path, NULL); in exp_parent()
865 return exp; in exp_parent()
879 struct svc_export *exp; in exp_rootfh() local
898 exp = exp_parent(cd, clp, &path); in exp_rootfh()
899 if (IS_ERR(exp)) { in exp_rootfh()
900 err = PTR_ERR(exp); in exp_rootfh()
908 if (fh_compose(&fh, exp, path.dentry, NULL)) in exp_rootfh()
914 exp_put(exp); in exp_rootfh()
924 struct svc_export *exp; in exp_find() local
930 exp = exp_get_by_name(cd, clp, &ek->ek_path, reqp); in exp_find()
933 if (IS_ERR(exp)) in exp_find()
934 return ERR_CAST(exp); in exp_find()
935 return exp; in exp_find()
938 __be32 check_nfsd_access(struct svc_export *exp, struct svc_rqst *rqstp) in check_nfsd_access() argument
941 struct exp_flavor_info *end = exp->ex_flavors + exp->ex_nflavors; in check_nfsd_access()
944 if (exp->ex_client == rqstp->rq_gssclient) in check_nfsd_access()
947 for (f = exp->ex_flavors; f < end; f++) { in check_nfsd_access()
952 if (exp->ex_nflavors == 0) { in check_nfsd_access()
972 struct svc_export *gssexp, *exp = ERR_PTR(-ENOENT); in rqst_exp_get_by_name() local
980 exp = exp_get_by_name(cd, rqstp->rq_client, path, &rqstp->rq_chandle); in rqst_exp_get_by_name()
981 if (PTR_ERR(exp) == -ENOENT) in rqst_exp_get_by_name()
983 if (IS_ERR(exp)) in rqst_exp_get_by_name()
984 return exp; in rqst_exp_get_by_name()
986 if (exp->ex_nflavors > 0) in rqst_exp_get_by_name()
987 return exp; in rqst_exp_get_by_name()
991 return exp; in rqst_exp_get_by_name()
994 return exp; in rqst_exp_get_by_name()
995 if (!IS_ERR(exp)) in rqst_exp_get_by_name()
996 exp_put(exp); in rqst_exp_get_by_name()
1003 struct svc_export *gssexp, *exp = ERR_PTR(-ENOENT); in rqst_exp_find() local
1011 exp = exp_find(cd, rqstp->rq_client, fsid_type, in rqst_exp_find()
1013 if (PTR_ERR(exp) == -ENOENT) in rqst_exp_find()
1015 if (IS_ERR(exp)) in rqst_exp_find()
1016 return exp; in rqst_exp_find()
1018 if (exp->ex_nflavors > 0) in rqst_exp_find()
1019 return exp; in rqst_exp_find()
1023 return exp; in rqst_exp_find()
1027 return exp; in rqst_exp_find()
1028 if (!IS_ERR(exp)) in rqst_exp_find()
1029 exp_put(exp); in rqst_exp_find()
1037 struct svc_export *exp = rqst_exp_get_by_name(rqstp, path); in rqst_exp_parent() local
1039 while (PTR_ERR(exp) == -ENOENT && !IS_ROOT(path->dentry)) { in rqst_exp_parent()
1043 exp = rqst_exp_get_by_name(rqstp, path); in rqst_exp_parent()
1047 return exp; in rqst_exp_parent()
1067 struct svc_export *exp; in exp_pseudoroot() local
1070 exp = rqst_find_fsidzero_export(rqstp); in exp_pseudoroot()
1071 if (IS_ERR(exp)) in exp_pseudoroot()
1072 return nfserrno(PTR_ERR(exp)); in exp_pseudoroot()
1073 rv = fh_compose(fhp, exp, exp->ex_path.dentry, NULL); in exp_pseudoroot()
1074 exp_put(exp); in exp_pseudoroot()
1139 static void show_secinfo(struct seq_file *m, struct svc_export *exp) in show_secinfo() argument
1142 struct exp_flavor_info *end = exp->ex_flavors + exp->ex_nflavors; in show_secinfo()
1145 if (exp->ex_nflavors == 0) in show_secinfo()
1147 f = exp->ex_flavors; in show_secinfo()
1149 if (!secinfo_flags_equal(flags, exp->ex_flags)) in show_secinfo()
1189 struct svc_export *exp = container_of(cp, struct svc_export, h); in e_show() local
1198 exp_get(exp); in e_show()
1199 if (cache_check(cd, &exp->h, NULL)) in e_show()
1201 exp_put(exp); in e_show()