Lines Matching refs:exp
352 struct svc_export *exp = container_of(ref, struct svc_export, h.ref);
353 path_put(&exp->ex_path);
354 auth_domain_put(exp->ex_client);
355 nfsd4_fslocs_free(&exp->ex_fslocs);
356 export_stats_destroy(&exp->ex_stats);
357 kfree(exp->ex_uuid);
358 kfree_rcu(exp, ex_rcu);
371 struct svc_export *exp = container_of(h, struct svc_export, h);
374 qword_add(bpp, blen, exp->ex_client->name);
375 pth = d_path(&exp->ex_path, *bpp, *blen);
504 static int secinfo_parse(char **mesg, char *buf, struct svc_export *exp)
511 if (exp->ex_nflavors)
520 for (f = exp->ex_flavors; f < exp->ex_flavors + listsize; f++) {
534 if (~NFSEXP_SECINFO_FLAGS & (f->flags ^ exp->ex_flags))
537 exp->ex_nflavors = listsize;
545 secinfo_parse(char **mesg, char *buf, struct svc_export *exp) { return 0; }
548 static int xprtsec_parse(char **mesg, char *buf, struct svc_export *exp)
559 exp->ex_xprtsec_modes = 0;
566 exp->ex_xprtsec_modes |= mode;
598 struct svc_export exp = {}, *expp;
624 err = kern_path(buf, 0, &exp.ex_path);
628 exp.ex_client = dom;
629 exp.cd = cd;
630 exp.ex_devid_map = NULL;
631 exp.ex_xprtsec_modes = NFSEXP_XPRTSEC_ALL;
634 err = get_expiry(&mesg, &exp.h.expiry_time);
642 set_bit(CACHE_NEGATIVE, &exp.h.flags);
646 exp.ex_flags= an_int;
652 exp.ex_anon_uid= make_kuid(current_user_ns(), an_int);
658 exp.ex_anon_gid= make_kgid(current_user_ns(), an_int);
664 exp.ex_fsid = an_int;
668 err = fsloc_parse(&mesg, buf, &exp.ex_fslocs);
670 err = nfsd_uuid_parse(&mesg, buf, &exp.ex_uuid);
672 err = secinfo_parse(&mesg, buf, &exp);
674 err = xprtsec_parse(&mesg, buf, &exp);
685 err = check_export(&exp.ex_path, &exp.ex_flags, exp.ex_uuid);
694 if (exp.h.expiry_time < seconds_since_boot())
704 if (!uid_valid(exp.ex_anon_uid))
706 if (!gid_valid(exp.ex_anon_gid))
710 nfsd4_setup_layout_type(&exp);
713 expp = svc_export_lookup(&exp);
718 expp = svc_export_update(&exp, expp);
726 nfsd4_fslocs_free(&exp.ex_fslocs);
727 kfree(exp.ex_uuid);
729 path_put(&exp.ex_path);
739 static void show_secinfo(struct seq_file *m, struct svc_export *exp);
755 struct svc_export *exp;
765 exp = container_of(h, struct svc_export, h);
766 seq_path(m, &exp->ex_path, " \t\n\\");
768 seq_escape(m, exp->ex_client->name, " \t\n\\");
770 seq_printf(m, "\t%lld\n", exp->ex_stats.start_time);
772 percpu_counter_sum_positive(&exp->ex_stats.counter[EXP_STATS_FH_STALE]));
774 percpu_counter_sum_positive(&exp->ex_stats.counter[EXP_STATS_IO_READ]));
776 percpu_counter_sum_positive(&exp->ex_stats.counter[EXP_STATS_IO_WRITE]));
783 exp_flags(m, exp->ex_flags, exp->ex_fsid,
784 exp->ex_anon_uid, exp->ex_anon_gid, &exp->ex_fslocs);
785 if (exp->ex_uuid) {
791 seq_printf(m, "%02x", exp->ex_uuid[i]);
794 show_secinfo(m, exp);
883 svc_export_hash(struct svc_export *exp)
887 hash = hash_ptr(exp->ex_client, EXPORT_HASHBITS);
888 hash ^= hash_ptr(exp->ex_path.dentry, EXPORT_HASHBITS);
889 hash ^= hash_ptr(exp->ex_path.mnt, EXPORT_HASHBITS);
894 svc_export_lookup(struct svc_export *exp)
897 int hash = svc_export_hash(exp);
899 ch = sunrpc_cache_lookup_rcu(exp->cd, &exp->h, hash);
949 struct svc_export *exp, key;
959 exp = svc_export_lookup(&key);
960 if (exp == NULL)
962 err = cache_check(cd, &exp->h, reqp);
967 return exp;
977 struct svc_export *exp = exp_get_by_name(cd, clp, path, NULL);
979 while (PTR_ERR(exp) == -ENOENT && !IS_ROOT(path->dentry)) {
983 exp = exp_get_by_name(cd, clp, path, NULL);
987 return exp;
1001 struct svc_export *exp;
1020 exp = exp_parent(cd, clp, &path);
1021 if (IS_ERR(exp)) {
1022 err = PTR_ERR(exp);
1030 if (fh_compose(&fh, exp, path.dentry, NULL))
1036 exp_put(exp);
1046 struct svc_export *exp;
1052 exp = exp_get_by_name(cd, clp, &ek->ek_path, reqp);
1055 if (IS_ERR(exp))
1056 return ERR_CAST(exp);
1057 return exp;
1060 __be32 check_nfsd_access(struct svc_export *exp, struct svc_rqst *rqstp)
1062 struct exp_flavor_info *f, *end = exp->ex_flavors + exp->ex_nflavors;
1065 if (exp->ex_xprtsec_modes & NFSEXP_XPRTSEC_NONE) {
1069 if (exp->ex_xprtsec_modes & NFSEXP_XPRTSEC_TLS) {
1074 if (exp->ex_xprtsec_modes & NFSEXP_XPRTSEC_MTLS) {
1083 if (exp->ex_client == rqstp->rq_gssclient)
1086 for (f = exp->ex_flavors; f < end; f++) {
1091 if (exp->ex_nflavors == 0) {
1122 struct svc_export *gssexp, *exp = ERR_PTR(-ENOENT);
1130 exp = exp_get_by_name(cd, rqstp->rq_client, path, &rqstp->rq_chandle);
1131 if (PTR_ERR(exp) == -ENOENT)
1133 if (IS_ERR(exp))
1134 return exp;
1136 if (exp->ex_nflavors > 0)
1137 return exp;
1141 return exp;
1144 return exp;
1145 if (!IS_ERR(exp))
1146 exp_put(exp);
1153 struct svc_export *gssexp, *exp = ERR_PTR(-ENOENT);
1161 exp = exp_find(cd, rqstp->rq_client, fsid_type,
1163 if (PTR_ERR(exp) == -ENOENT)
1165 if (IS_ERR(exp))
1166 return exp;
1168 if (exp->ex_nflavors > 0)
1169 return exp;
1173 return exp;
1177 return exp;
1178 if (!IS_ERR(exp))
1179 exp_put(exp);
1187 struct svc_export *exp = rqst_exp_get_by_name(rqstp, path);
1189 while (PTR_ERR(exp) == -ENOENT && !IS_ROOT(path->dentry)) {
1193 exp = rqst_exp_get_by_name(rqstp, path);
1197 return exp;
1217 struct svc_export *exp;
1220 exp = rqst_find_fsidzero_export(rqstp);
1221 if (IS_ERR(exp))
1222 return nfserrno(PTR_ERR(exp));
1223 rv = fh_compose(fhp, exp, exp->ex_path.dentry, NULL);
1224 exp_put(exp);
1290 static void show_secinfo(struct seq_file *m, struct svc_export *exp)
1293 struct exp_flavor_info *end = exp->ex_flavors + exp->ex_nflavors;
1296 if (exp->ex_nflavors == 0)
1298 f = exp->ex_flavors;
1300 if (!secinfo_flags_equal(flags, exp->ex_flags))
1342 struct svc_export *exp = container_of(cp, struct svc_export, h);
1355 exp_get(exp);
1356 if (cache_check(cd, &exp->h, NULL))
1358 exp_put(exp);