Lines Matching refs:exp
336 struct svc_export *exp = container_of(ref, struct svc_export, h.ref); in svc_export_put() local
337 path_put(&exp->ex_path); in svc_export_put()
338 auth_domain_put(exp->ex_client); in svc_export_put()
339 nfsd4_fslocs_free(&exp->ex_fslocs); in svc_export_put()
340 kfree(exp->ex_uuid); in svc_export_put()
341 kfree_rcu(exp, ex_rcu); in svc_export_put()
354 struct svc_export *exp = container_of(h, struct svc_export, h); in svc_export_request() local
357 qword_add(bpp, blen, exp->ex_client->name); in svc_export_request()
358 pth = d_path(&exp->ex_path, *bpp, *blen); in svc_export_request()
475 static int secinfo_parse(char **mesg, char *buf, struct svc_export *exp) in secinfo_parse() argument
482 if (exp->ex_nflavors) in secinfo_parse()
491 for (f = exp->ex_flavors; f < exp->ex_flavors + listsize; f++) { in secinfo_parse()
505 if (~NFSEXP_SECINFO_FLAGS & (f->flags ^ exp->ex_flags)) in secinfo_parse()
508 exp->ex_nflavors = listsize; in secinfo_parse()
516 secinfo_parse(char **mesg, char *buf, struct svc_export *exp) { return 0; } in secinfo_parse() argument
547 struct svc_export exp = {}, *expp; in svc_export_parse() local
574 err = kern_path(buf, 0, &exp.ex_path); in svc_export_parse()
578 exp.ex_client = dom; in svc_export_parse()
579 exp.cd = cd; in svc_export_parse()
580 exp.ex_devid_map = NULL; in svc_export_parse()
584 exp.h.expiry_time = get_expiry(&mesg); in svc_export_parse()
585 if (exp.h.expiry_time == 0) in svc_export_parse()
592 set_bit(CACHE_NEGATIVE, &exp.h.flags); in svc_export_parse()
596 exp.ex_flags= an_int; in svc_export_parse()
602 exp.ex_anon_uid= make_kuid(current_user_ns(), an_int); in svc_export_parse()
608 exp.ex_anon_gid= make_kgid(current_user_ns(), an_int); in svc_export_parse()
614 exp.ex_fsid = an_int; in svc_export_parse()
618 err = fsloc_parse(&mesg, buf, &exp.ex_fslocs); in svc_export_parse()
620 err = nfsd_uuid_parse(&mesg, buf, &exp.ex_uuid); in svc_export_parse()
622 err = secinfo_parse(&mesg, buf, &exp); in svc_export_parse()
633 err = check_export(d_inode(exp.ex_path.dentry), &exp.ex_flags, in svc_export_parse()
634 exp.ex_uuid); in svc_export_parse()
642 if (exp.h.expiry_time < seconds_since_boot()) in svc_export_parse()
652 if (!uid_valid(exp.ex_anon_uid)) in svc_export_parse()
654 if (!gid_valid(exp.ex_anon_gid)) in svc_export_parse()
658 nfsd4_setup_layout_type(&exp); in svc_export_parse()
661 expp = svc_export_lookup(&exp); in svc_export_parse()
666 expp = svc_export_update(&exp, expp); in svc_export_parse()
674 nfsd4_fslocs_free(&exp.ex_fslocs); in svc_export_parse()
675 kfree(exp.ex_uuid); in svc_export_parse()
677 path_put(&exp.ex_path); in svc_export_parse()
687 static void show_secinfo(struct seq_file *m, struct svc_export *exp);
693 struct svc_export *exp ; in svc_export_show() local
699 exp = container_of(h, struct svc_export, h); in svc_export_show()
700 seq_path(m, &exp->ex_path, " \t\n\\"); in svc_export_show()
702 seq_escape(m, exp->ex_client->name, " \t\n\\"); in svc_export_show()
706 exp_flags(m, exp->ex_flags, exp->ex_fsid, in svc_export_show()
707 exp->ex_anon_uid, exp->ex_anon_gid, &exp->ex_fslocs); in svc_export_show()
708 if (exp->ex_uuid) { in svc_export_show()
714 seq_printf(m, "%02x", exp->ex_uuid[i]); in svc_export_show()
717 show_secinfo(m, exp); in svc_export_show()
799 svc_export_hash(struct svc_export *exp) in svc_export_hash() argument
803 hash = hash_ptr(exp->ex_client, EXPORT_HASHBITS); in svc_export_hash()
804 hash ^= hash_ptr(exp->ex_path.dentry, EXPORT_HASHBITS); in svc_export_hash()
805 hash ^= hash_ptr(exp->ex_path.mnt, EXPORT_HASHBITS); in svc_export_hash()
810 svc_export_lookup(struct svc_export *exp) in svc_export_lookup() argument
813 int hash = svc_export_hash(exp); in svc_export_lookup()
815 ch = sunrpc_cache_lookup_rcu(exp->cd, &exp->h, hash); in svc_export_lookup()
865 struct svc_export *exp, key; in exp_get_by_name() local
875 exp = svc_export_lookup(&key); in exp_get_by_name()
876 if (exp == NULL) in exp_get_by_name()
878 err = cache_check(cd, &exp->h, reqp); in exp_get_by_name()
883 return exp; in exp_get_by_name()
893 struct svc_export *exp = exp_get_by_name(cd, clp, path, NULL); in exp_parent() local
895 while (PTR_ERR(exp) == -ENOENT && !IS_ROOT(path->dentry)) { in exp_parent()
899 exp = exp_get_by_name(cd, clp, path, NULL); in exp_parent()
903 return exp; in exp_parent()
917 struct svc_export *exp; in exp_rootfh() local
936 exp = exp_parent(cd, clp, &path); in exp_rootfh()
937 if (IS_ERR(exp)) { in exp_rootfh()
938 err = PTR_ERR(exp); in exp_rootfh()
946 if (fh_compose(&fh, exp, path.dentry, NULL)) in exp_rootfh()
952 exp_put(exp); in exp_rootfh()
962 struct svc_export *exp; in exp_find() local
968 exp = exp_get_by_name(cd, clp, &ek->ek_path, reqp); in exp_find()
971 if (IS_ERR(exp)) in exp_find()
972 return ERR_CAST(exp); in exp_find()
973 return exp; in exp_find()
976 __be32 check_nfsd_access(struct svc_export *exp, struct svc_rqst *rqstp) in check_nfsd_access() argument
979 struct exp_flavor_info *end = exp->ex_flavors + exp->ex_nflavors; in check_nfsd_access()
982 if (exp->ex_client == rqstp->rq_gssclient) in check_nfsd_access()
985 for (f = exp->ex_flavors; f < end; f++) { in check_nfsd_access()
990 if (exp->ex_nflavors == 0) { in check_nfsd_access()
1020 struct svc_export *gssexp, *exp = ERR_PTR(-ENOENT); in rqst_exp_get_by_name() local
1028 exp = exp_get_by_name(cd, rqstp->rq_client, path, &rqstp->rq_chandle); in rqst_exp_get_by_name()
1029 if (PTR_ERR(exp) == -ENOENT) in rqst_exp_get_by_name()
1031 if (IS_ERR(exp)) in rqst_exp_get_by_name()
1032 return exp; in rqst_exp_get_by_name()
1034 if (exp->ex_nflavors > 0) in rqst_exp_get_by_name()
1035 return exp; in rqst_exp_get_by_name()
1039 return exp; in rqst_exp_get_by_name()
1042 return exp; in rqst_exp_get_by_name()
1043 if (!IS_ERR(exp)) in rqst_exp_get_by_name()
1044 exp_put(exp); in rqst_exp_get_by_name()
1051 struct svc_export *gssexp, *exp = ERR_PTR(-ENOENT); in rqst_exp_find() local
1059 exp = exp_find(cd, rqstp->rq_client, fsid_type, in rqst_exp_find()
1061 if (PTR_ERR(exp) == -ENOENT) in rqst_exp_find()
1063 if (IS_ERR(exp)) in rqst_exp_find()
1064 return exp; in rqst_exp_find()
1066 if (exp->ex_nflavors > 0) in rqst_exp_find()
1067 return exp; in rqst_exp_find()
1071 return exp; in rqst_exp_find()
1075 return exp; in rqst_exp_find()
1076 if (!IS_ERR(exp)) in rqst_exp_find()
1077 exp_put(exp); in rqst_exp_find()
1085 struct svc_export *exp = rqst_exp_get_by_name(rqstp, path); in rqst_exp_parent() local
1087 while (PTR_ERR(exp) == -ENOENT && !IS_ROOT(path->dentry)) { in rqst_exp_parent()
1091 exp = rqst_exp_get_by_name(rqstp, path); in rqst_exp_parent()
1095 return exp; in rqst_exp_parent()
1115 struct svc_export *exp; in exp_pseudoroot() local
1118 exp = rqst_find_fsidzero_export(rqstp); in exp_pseudoroot()
1119 if (IS_ERR(exp)) in exp_pseudoroot()
1120 return nfserrno(PTR_ERR(exp)); in exp_pseudoroot()
1121 rv = fh_compose(fhp, exp, exp->ex_path.dentry, NULL); in exp_pseudoroot()
1122 exp_put(exp); in exp_pseudoroot()
1188 static void show_secinfo(struct seq_file *m, struct svc_export *exp) in show_secinfo() argument
1191 struct exp_flavor_info *end = exp->ex_flavors + exp->ex_nflavors; in show_secinfo()
1194 if (exp->ex_nflavors == 0) in show_secinfo()
1196 f = exp->ex_flavors; in show_secinfo()
1198 if (!secinfo_flags_equal(flags, exp->ex_flags)) in show_secinfo()
1240 struct svc_export *exp = container_of(cp, struct svc_export, h); in e_show() local
1249 exp_get(exp); in e_show()
1250 if (cache_check(cd, &exp->h, NULL)) in e_show()
1252 exp_put(exp); in e_show()