Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Jan Blunck and committed by
Linus Torvalds
e83aece3 54775491

+14 -19
+13 -17
fs/nfsd/export.c
··· 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 } ··· 167 169 goto out; 168 170 169 171 dprintk("Found the path %s\n", buf); 170 - key.ek_mnt = nd.path.mnt; 171 - key.ek_dentry = nd.path.dentry; 172 - 172 + key.ek_path = nd.path; 173 + 173 174 ek = svc_expkey_update(&key, ek); 174 175 if (ek) 175 176 cache_put(&ek->h, &svc_expkey_cache); ··· 203 206 if (test_bit(CACHE_VALID, &h->flags) && 204 207 !test_bit(CACHE_NEGATIVE, &h->flags)) { 205 208 seq_printf(m, " "); 206 - seq_path(m, ek->ek_mnt, ek->ek_dentry, "\\ \t\n"); 209 + seq_path(m, ek->ek_path.mnt, ek->ek_path.dentry, "\\ \t\n"); 207 210 } 208 211 seq_printf(m, "\n"); 209 212 return 0; ··· 240 243 struct svc_expkey *new = container_of(cnew, struct svc_expkey, h); 241 244 struct svc_expkey *item = container_of(citem, struct svc_expkey, h); 242 245 243 - new->ek_mnt = mntget(item->ek_mnt); 244 - new->ek_dentry = dget(item->ek_dentry); 246 + new->ek_path = item->ek_path; 247 + path_get(&item->ek_path); 245 248 } 246 249 247 250 static struct cache_head *expkey_alloc(void) ··· 811 814 key.ek_client = clp; 812 815 key.ek_fsidtype = fsid_type; 813 816 memcpy(key.ek_fsid, fsidv, key_len(fsid_type)); 814 - key.ek_mnt = exp->ex_path.mnt; 815 - key.ek_dentry = exp->ex_path.dentry; 817 + key.ek_path = exp->ex_path; 816 818 key.h.expiry_time = NEVER; 817 819 key.h.flags = 0; 818 820 ··· 860 864 { 861 865 struct svc_export *exp, key; 862 866 int err; 863 - 867 + 864 868 if (!clp) 865 869 return ERR_PTR(-ENOENT); 866 870 ··· 1032 1036 /* must make sure there won't be an ex_fsid clash */ 1033 1037 if ((nxp->ex_flags & NFSEXP_FSID) && 1034 1038 (!IS_ERR(fsid_key = exp_get_fsid_key(clp, nxp->ex_dev))) && 1035 - fsid_key->ek_mnt && 1036 - (fsid_key->ek_mnt != nd.path.mnt || 1037 - fsid_key->ek_dentry != nd.path.dentry)) 1039 + fsid_key->ek_path.mnt && 1040 + (fsid_key->ek_path.mnt != nd.path.mnt || 1041 + fsid_key->ek_path.dentry != nd.path.dentry)) 1038 1042 goto finish; 1039 1043 1040 1044 if (!IS_ERR(exp)) { ··· 1214 1218 if (IS_ERR(ek)) 1215 1219 return ERR_CAST(ek); 1216 1220 1217 - exp = exp_get_by_name(clp, ek->ek_mnt, ek->ek_dentry, reqp); 1221 + exp = exp_get_by_name(clp, ek->ek_path.mnt, ek->ek_path.dentry, reqp); 1218 1222 cache_put(&ek->h, &svc_expkey_cache); 1219 1223 1220 1224 if (IS_ERR(exp))
+1 -2
include/linux/nfsd/export.h
··· 106 106 int ek_fsidtype; 107 107 u32 ek_fsid[6]; 108 108 109 - struct vfsmount * ek_mnt; 110 - struct dentry * ek_dentry; 109 + struct path ek_path; 111 110 }; 112 111 113 112 #define EX_SECURE(exp) (!((exp)->ex_flags & NFSEXP_INSECURE_PORT))