Commit 55430e2ecee574e729c12d4063b3ecabfa98fa82

Authored by Al Viro
1 parent dd5cae6e97

nfsd struct path use: exp_get_by_name()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Showing 1 changed file with 18 additions and 20 deletions Side-by-side Diff

... ... @@ -847,9 +847,8 @@
847 847 return exp_find_key(clp, FSID_NUM, fsidv, NULL);
848 848 }
849 849  
850   -static svc_export *exp_get_by_name(svc_client *clp, struct vfsmount *mnt,
851   - struct dentry *dentry,
852   - struct cache_req *reqp)
  850 +static svc_export *exp_get_by_name(svc_client *clp, const struct path *path,
  851 + struct cache_req *reqp)
853 852 {
854 853 struct svc_export *exp, key;
855 854 int err;
... ... @@ -858,8 +857,7 @@
858 857 return ERR_PTR(-ENOENT);
859 858  
860 859 key.ex_client = clp;
861   - key.ex_path.mnt = mnt;
862   - key.ex_path.dentry = dentry;
  860 + key.ex_path = *path;
863 861  
864 862 exp = svc_export_lookup(&key);
865 863 if (exp == NULL)
866 864  
867 865  
868 866  
... ... @@ -877,20 +875,19 @@
877 875 struct dentry *dentry,
878 876 struct cache_req *reqp)
879 877 {
  878 + struct path path = {.mnt = mnt, .dentry = dentry};
880 879 svc_export *exp;
881 880  
882   - dget(dentry);
883   - exp = exp_get_by_name(clp, mnt, dentry, reqp);
  881 + dget(path.dentry);
  882 + exp = exp_get_by_name(clp, &path, reqp);
884 883  
885   - while (PTR_ERR(exp) == -ENOENT && !IS_ROOT(dentry)) {
886   - struct dentry *parent;
887   -
888   - parent = dget_parent(dentry);
889   - dput(dentry);
890   - dentry = parent;
891   - exp = exp_get_by_name(clp, mnt, dentry, reqp);
  884 + while (PTR_ERR(exp) == -ENOENT && !IS_ROOT(path.dentry)) {
  885 + struct dentry *parent = dget_parent(path.dentry);
  886 + dput(path.dentry);
  887 + path.dentry = parent;
  888 + exp = exp_get_by_name(clp, &path, reqp);
892 889 }
893   - dput(dentry);
  890 + dput(path.dentry);
894 891 return exp;
895 892 }
896 893  
... ... @@ -1018,7 +1015,7 @@
1018 1015 goto out_put_clp;
1019 1016 err = -EINVAL;
1020 1017  
1021   - exp = exp_get_by_name(clp, path.mnt, path.dentry, NULL);
  1018 + exp = exp_get_by_name(clp, &path, NULL);
1022 1019  
1023 1020 memset(&new, 0, sizeof(new));
1024 1021  
... ... @@ -1135,7 +1132,7 @@
1135 1132 goto out_domain;
1136 1133  
1137 1134 err = -EINVAL;
1138   - exp = exp_get_by_name(dom, path.mnt, path.dentry, NULL);
  1135 + exp = exp_get_by_name(dom, &path, NULL);
1139 1136 path_put(&path);
1140 1137 if (IS_ERR(exp))
1141 1138 goto out_domain;
... ... @@ -1207,7 +1204,7 @@
1207 1204 if (IS_ERR(ek))
1208 1205 return ERR_CAST(ek);
1209 1206  
1210   - exp = exp_get_by_name(clp, ek->ek_path.mnt, ek->ek_path.dentry, reqp);
  1207 + exp = exp_get_by_name(clp, &ek->ek_path, reqp);
1211 1208 cache_put(&ek->h, &svc_expkey_cache);
1212 1209  
1213 1210 if (IS_ERR(exp))
1214 1211  
... ... @@ -1251,12 +1248,13 @@
1251 1248 struct dentry *dentry)
1252 1249 {
1253 1250 struct svc_export *gssexp, *exp = ERR_PTR(-ENOENT);
  1251 + struct path path = {.mnt = mnt, .dentry = dentry};
1254 1252  
1255 1253 if (rqstp->rq_client == NULL)
1256 1254 goto gss;
1257 1255  
1258 1256 /* First try the auth_unix client: */
1259   - exp = exp_get_by_name(rqstp->rq_client, mnt, dentry,
  1257 + exp = exp_get_by_name(rqstp->rq_client, &path,
1260 1258 &rqstp->rq_chandle);
1261 1259 if (PTR_ERR(exp) == -ENOENT)
1262 1260 goto gss;
... ... @@ -1269,7 +1267,7 @@
1269 1267 /* Otherwise, try falling back on gss client */
1270 1268 if (rqstp->rq_gssclient == NULL)
1271 1269 return exp;
1272   - gssexp = exp_get_by_name(rqstp->rq_gssclient, mnt, dentry,
  1270 + gssexp = exp_get_by_name(rqstp->rq_gssclient, &path,
1273 1271 &rqstp->rq_chandle);
1274 1272 if (PTR_ERR(gssexp) == -ENOENT)
1275 1273 return exp;