Commit e83aece3afad4d56cc01abe069d3519e851cd2de
Committed by
Linus Torvalds
1 parent
5477549161
Exists in
master
and in
7 other branches
Use struct path in struct svc_expkey
I'm embedding struct path into struct svc_expkey. Signed-off-by: Jan Blunck <jblunck@suse.de> Cc: Al Viro <viro@zeniv.linux.org.uk> Acked-by: "J. Bruce Fields" <bfields@fieldses.org> Cc: Neil Brown <neilb@suse.de> Cc: Christoph Hellwig <hch@lst.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Showing 2 changed files with 14 additions and 19 deletions Side-by-side Diff
fs/nfsd/export.c
... | ... | @@ -63,10 +63,8 @@ |
63 | 63 | struct svc_expkey *key = container_of(ref, struct svc_expkey, h.ref); |
64 | 64 | |
65 | 65 | if (test_bit(CACHE_VALID, &key->h.flags) && |
66 | - !test_bit(CACHE_NEGATIVE, &key->h.flags)) { | |
67 | - dput(key->ek_dentry); | |
68 | - mntput(key->ek_mnt); | |
69 | - } | |
66 | + !test_bit(CACHE_NEGATIVE, &key->h.flags)) | |
67 | + path_put(&key->ek_path); | |
70 | 68 | auth_domain_put(key->ek_client); |
71 | 69 | kfree(key); |
72 | 70 | } |
... | ... | @@ -169,9 +167,8 @@ |
169 | 167 | goto out; |
170 | 168 | |
171 | 169 | dprintk("Found the path %s\n", buf); |
172 | - key.ek_mnt = nd.path.mnt; | |
173 | - key.ek_dentry = nd.path.dentry; | |
174 | - | |
170 | + key.ek_path = nd.path; | |
171 | + | |
175 | 172 | ek = svc_expkey_update(&key, ek); |
176 | 173 | if (ek) |
177 | 174 | cache_put(&ek->h, &svc_expkey_cache); |
... | ... | @@ -206,7 +203,7 @@ |
206 | 203 | if (test_bit(CACHE_VALID, &h->flags) && |
207 | 204 | !test_bit(CACHE_NEGATIVE, &h->flags)) { |
208 | 205 | seq_printf(m, " "); |
209 | - seq_path(m, ek->ek_mnt, ek->ek_dentry, "\ \t\n"); | |
206 | + seq_path(m, ek->ek_path.mnt, ek->ek_path.dentry, "\ \t\n"); | |
210 | 207 | } |
211 | 208 | seq_printf(m, "\n"); |
212 | 209 | return 0; |
... | ... | @@ -243,8 +240,8 @@ |
243 | 240 | struct svc_expkey *new = container_of(cnew, struct svc_expkey, h); |
244 | 241 | struct svc_expkey *item = container_of(citem, struct svc_expkey, h); |
245 | 242 | |
246 | - new->ek_mnt = mntget(item->ek_mnt); | |
247 | - new->ek_dentry = dget(item->ek_dentry); | |
243 | + new->ek_path = item->ek_path; | |
244 | + path_get(&item->ek_path); | |
248 | 245 | } |
249 | 246 | |
250 | 247 | static struct cache_head *expkey_alloc(void) |
... | ... | @@ -814,8 +811,7 @@ |
814 | 811 | key.ek_client = clp; |
815 | 812 | key.ek_fsidtype = fsid_type; |
816 | 813 | memcpy(key.ek_fsid, fsidv, key_len(fsid_type)); |
817 | - key.ek_mnt = exp->ex_path.mnt; | |
818 | - key.ek_dentry = exp->ex_path.dentry; | |
814 | + key.ek_path = exp->ex_path; | |
819 | 815 | key.h.expiry_time = NEVER; |
820 | 816 | key.h.flags = 0; |
821 | 817 | |
... | ... | @@ -864,7 +860,7 @@ |
864 | 860 | { |
865 | 861 | struct svc_export *exp, key; |
866 | 862 | int err; |
867 | - | |
863 | + | |
868 | 864 | if (!clp) |
869 | 865 | return ERR_PTR(-ENOENT); |
870 | 866 | |
... | ... | @@ -1036,9 +1032,9 @@ |
1036 | 1032 | /* must make sure there won't be an ex_fsid clash */ |
1037 | 1033 | if ((nxp->ex_flags & NFSEXP_FSID) && |
1038 | 1034 | (!IS_ERR(fsid_key = exp_get_fsid_key(clp, nxp->ex_dev))) && |
1039 | - fsid_key->ek_mnt && | |
1040 | - (fsid_key->ek_mnt != nd.path.mnt || | |
1041 | - fsid_key->ek_dentry != nd.path.dentry)) | |
1035 | + fsid_key->ek_path.mnt && | |
1036 | + (fsid_key->ek_path.mnt != nd.path.mnt || | |
1037 | + fsid_key->ek_path.dentry != nd.path.dentry)) | |
1042 | 1038 | goto finish; |
1043 | 1039 | |
1044 | 1040 | if (!IS_ERR(exp)) { |
... | ... | @@ -1218,7 +1214,7 @@ |
1218 | 1214 | if (IS_ERR(ek)) |
1219 | 1215 | return ERR_CAST(ek); |
1220 | 1216 | |
1221 | - exp = exp_get_by_name(clp, ek->ek_mnt, ek->ek_dentry, reqp); | |
1217 | + exp = exp_get_by_name(clp, ek->ek_path.mnt, ek->ek_path.dentry, reqp); | |
1222 | 1218 | cache_put(&ek->h, &svc_expkey_cache); |
1223 | 1219 | |
1224 | 1220 | if (IS_ERR(exp)) |
include/linux/nfsd/export.h