diff options
author | Jan Blunck <jblunck@suse.de> | 2008-02-14 22:38:39 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-15 00:17:08 -0500 |
commit | 5477549161480432d053565d2720f08626baf9e3 (patch) | |
tree | 0993666627a6f53f5c7cc9277a329760ccc1002d | |
parent | 448678a0f3cdd0157f00e98bd337e32030273637 (diff) |
Use struct path in struct svc_export
I'm embedding struct path into struct svc_export.
[akpm@linux-foundation.org: coding-style fixes]
[ezk@cs.sunysb.edu: NFSD: fix wrong mnt_writer count in rename]
Signed-off-by: Jan Blunck <jblunck@suse.de>
Acked-by: J. Bruce Fields <bfields@citi.umich.edu>
Acked-by: Christoph Hellwig <hch@infradead.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: "J. Bruce Fields" <bfields@fieldses.org>
Cc: Neil Brown <neilb@suse.de>
Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | fs/nfsd/export.c | 67 | ||||
-rw-r--r-- | fs/nfsd/nfs3proc.c | 2 | ||||
-rw-r--r-- | fs/nfsd/nfs3xdr.c | 4 | ||||
-rw-r--r-- | fs/nfsd/nfs4xdr.c | 12 | ||||
-rw-r--r-- | fs/nfsd/nfsfh.c | 26 | ||||
-rw-r--r-- | fs/nfsd/nfsproc.c | 6 | ||||
-rw-r--r-- | fs/nfsd/nfsxdr.c | 2 | ||||
-rw-r--r-- | fs/nfsd/vfs.c | 13 | ||||
-rw-r--r-- | include/linux/nfsd/export.h | 5 |
9 files changed, 67 insertions, 70 deletions
diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c index 717413f07e9a..7d7896814fa4 100644 --- a/fs/nfsd/export.c +++ b/fs/nfsd/export.c | |||
@@ -332,10 +332,9 @@ static void nfsd4_fslocs_free(struct nfsd4_fs_locations *fsloc) | |||
332 | static void svc_export_put(struct kref *ref) | 332 | static void svc_export_put(struct kref *ref) |
333 | { | 333 | { |
334 | struct svc_export *exp = container_of(ref, struct svc_export, h.ref); | 334 | struct svc_export *exp = container_of(ref, struct svc_export, h.ref); |
335 | dput(exp->ex_dentry); | 335 | path_put(&exp->ex_path); |
336 | mntput(exp->ex_mnt); | ||
337 | auth_domain_put(exp->ex_client); | 336 | auth_domain_put(exp->ex_client); |
338 | kfree(exp->ex_path); | 337 | kfree(exp->ex_pathname); |
339 | nfsd4_fslocs_free(&exp->ex_fslocs); | 338 | nfsd4_fslocs_free(&exp->ex_fslocs); |
340 | kfree(exp); | 339 | kfree(exp); |
341 | } | 340 | } |
@@ -349,7 +348,7 @@ static void svc_export_request(struct cache_detail *cd, | |||
349 | char *pth; | 348 | char *pth; |
350 | 349 | ||
351 | qword_add(bpp, blen, exp->ex_client->name); | 350 | qword_add(bpp, blen, exp->ex_client->name); |
352 | pth = d_path(exp->ex_dentry, exp->ex_mnt, *bpp, *blen); | 351 | pth = d_path(exp->ex_path.dentry, exp->ex_path.mnt, *bpp, *blen); |
353 | if (IS_ERR(pth)) { | 352 | if (IS_ERR(pth)) { |
354 | /* is this correct? */ | 353 | /* is this correct? */ |
355 | (*bpp)[0] = '\n'; | 354 | (*bpp)[0] = '\n'; |
@@ -508,7 +507,7 @@ static int svc_export_parse(struct cache_detail *cd, char *mesg, int mlen) | |||
508 | int an_int; | 507 | int an_int; |
509 | 508 | ||
510 | nd.path.dentry = NULL; | 509 | nd.path.dentry = NULL; |
511 | exp.ex_path = NULL; | 510 | exp.ex_pathname = NULL; |
512 | 511 | ||
513 | /* fs locations */ | 512 | /* fs locations */ |
514 | exp.ex_fslocs.locations = NULL; | 513 | exp.ex_fslocs.locations = NULL; |
@@ -547,11 +546,11 @@ static int svc_export_parse(struct cache_detail *cd, char *mesg, int mlen) | |||
547 | 546 | ||
548 | exp.h.flags = 0; | 547 | exp.h.flags = 0; |
549 | exp.ex_client = dom; | 548 | exp.ex_client = dom; |
550 | exp.ex_mnt = nd.path.mnt; | 549 | exp.ex_path.mnt = nd.path.mnt; |
551 | exp.ex_dentry = nd.path.dentry; | 550 | exp.ex_path.dentry = nd.path.dentry; |
552 | exp.ex_path = kstrdup(buf, GFP_KERNEL); | 551 | exp.ex_pathname = kstrdup(buf, GFP_KERNEL); |
553 | err = -ENOMEM; | 552 | err = -ENOMEM; |
554 | if (!exp.ex_path) | 553 | if (!exp.ex_pathname) |
555 | goto out; | 554 | goto out; |
556 | 555 | ||
557 | /* expiry */ | 556 | /* expiry */ |
@@ -628,7 +627,7 @@ static int svc_export_parse(struct cache_detail *cd, char *mesg, int mlen) | |||
628 | out: | 627 | out: |
629 | nfsd4_fslocs_free(&exp.ex_fslocs); | 628 | nfsd4_fslocs_free(&exp.ex_fslocs); |
630 | kfree(exp.ex_uuid); | 629 | kfree(exp.ex_uuid); |
631 | kfree(exp.ex_path); | 630 | kfree(exp.ex_pathname); |
632 | if (nd.path.dentry) | 631 | if (nd.path.dentry) |
633 | path_put(&nd.path); | 632 | path_put(&nd.path); |
634 | out_no_path: | 633 | out_no_path: |
@@ -653,7 +652,7 @@ static int svc_export_show(struct seq_file *m, | |||
653 | return 0; | 652 | return 0; |
654 | } | 653 | } |
655 | exp = container_of(h, struct svc_export, h); | 654 | exp = container_of(h, struct svc_export, h); |
656 | seq_path(m, exp->ex_mnt, exp->ex_dentry, " \t\n\\"); | 655 | seq_path(m, exp->ex_path.mnt, exp->ex_path.dentry, " \t\n\\"); |
657 | seq_putc(m, '\t'); | 656 | seq_putc(m, '\t'); |
658 | seq_escape(m, exp->ex_client->name, " \t\n\\"); | 657 | seq_escape(m, exp->ex_client->name, " \t\n\\"); |
659 | seq_putc(m, '('); | 658 | seq_putc(m, '('); |
@@ -680,8 +679,8 @@ static int svc_export_match(struct cache_head *a, struct cache_head *b) | |||
680 | struct svc_export *orig = container_of(a, struct svc_export, h); | 679 | struct svc_export *orig = container_of(a, struct svc_export, h); |
681 | struct svc_export *new = container_of(b, struct svc_export, h); | 680 | struct svc_export *new = container_of(b, struct svc_export, h); |
682 | return orig->ex_client == new->ex_client && | 681 | return orig->ex_client == new->ex_client && |
683 | orig->ex_dentry == new->ex_dentry && | 682 | orig->ex_path.dentry == new->ex_path.dentry && |
684 | orig->ex_mnt == new->ex_mnt; | 683 | orig->ex_path.mnt == new->ex_path.mnt; |
685 | } | 684 | } |
686 | 685 | ||
687 | static void svc_export_init(struct cache_head *cnew, struct cache_head *citem) | 686 | static void svc_export_init(struct cache_head *cnew, struct cache_head *citem) |
@@ -691,9 +690,9 @@ static void svc_export_init(struct cache_head *cnew, struct cache_head *citem) | |||
691 | 690 | ||
692 | kref_get(&item->ex_client->ref); | 691 | kref_get(&item->ex_client->ref); |
693 | new->ex_client = item->ex_client; | 692 | new->ex_client = item->ex_client; |
694 | new->ex_dentry = dget(item->ex_dentry); | 693 | new->ex_path.dentry = dget(item->ex_path.dentry); |
695 | new->ex_mnt = mntget(item->ex_mnt); | 694 | new->ex_path.mnt = mntget(item->ex_path.mnt); |
696 | new->ex_path = NULL; | 695 | new->ex_pathname = NULL; |
697 | new->ex_fslocs.locations = NULL; | 696 | new->ex_fslocs.locations = NULL; |
698 | new->ex_fslocs.locations_count = 0; | 697 | new->ex_fslocs.locations_count = 0; |
699 | new->ex_fslocs.migrated = 0; | 698 | new->ex_fslocs.migrated = 0; |
@@ -711,8 +710,8 @@ static void export_update(struct cache_head *cnew, struct cache_head *citem) | |||
711 | new->ex_fsid = item->ex_fsid; | 710 | new->ex_fsid = item->ex_fsid; |
712 | new->ex_uuid = item->ex_uuid; | 711 | new->ex_uuid = item->ex_uuid; |
713 | item->ex_uuid = NULL; | 712 | item->ex_uuid = NULL; |
714 | new->ex_path = item->ex_path; | 713 | new->ex_pathname = item->ex_pathname; |
715 | item->ex_path = NULL; | 714 | item->ex_pathname = NULL; |
716 | new->ex_fslocs.locations = item->ex_fslocs.locations; | 715 | new->ex_fslocs.locations = item->ex_fslocs.locations; |
717 | item->ex_fslocs.locations = NULL; | 716 | item->ex_fslocs.locations = NULL; |
718 | new->ex_fslocs.locations_count = item->ex_fslocs.locations_count; | 717 | new->ex_fslocs.locations_count = item->ex_fslocs.locations_count; |
@@ -755,8 +754,8 @@ svc_export_lookup(struct svc_export *exp) | |||
755 | struct cache_head *ch; | 754 | struct cache_head *ch; |
756 | int hash; | 755 | int hash; |
757 | hash = hash_ptr(exp->ex_client, EXPORT_HASHBITS); | 756 | hash = hash_ptr(exp->ex_client, EXPORT_HASHBITS); |
758 | hash ^= hash_ptr(exp->ex_dentry, EXPORT_HASHBITS); | 757 | hash ^= hash_ptr(exp->ex_path.dentry, EXPORT_HASHBITS); |
759 | hash ^= hash_ptr(exp->ex_mnt, EXPORT_HASHBITS); | 758 | hash ^= hash_ptr(exp->ex_path.mnt, EXPORT_HASHBITS); |
760 | 759 | ||
761 | ch = sunrpc_cache_lookup(&svc_export_cache, &exp->h, | 760 | ch = sunrpc_cache_lookup(&svc_export_cache, &exp->h, |
762 | hash); | 761 | hash); |
@@ -772,8 +771,8 @@ svc_export_update(struct svc_export *new, struct svc_export *old) | |||
772 | struct cache_head *ch; | 771 | struct cache_head *ch; |
773 | int hash; | 772 | int hash; |
774 | hash = hash_ptr(old->ex_client, EXPORT_HASHBITS); | 773 | hash = hash_ptr(old->ex_client, EXPORT_HASHBITS); |
775 | hash ^= hash_ptr(old->ex_dentry, EXPORT_HASHBITS); | 774 | hash ^= hash_ptr(old->ex_path.dentry, EXPORT_HASHBITS); |
776 | hash ^= hash_ptr(old->ex_mnt, EXPORT_HASHBITS); | 775 | hash ^= hash_ptr(old->ex_path.mnt, EXPORT_HASHBITS); |
777 | 776 | ||
778 | ch = sunrpc_cache_update(&svc_export_cache, &new->h, | 777 | ch = sunrpc_cache_update(&svc_export_cache, &new->h, |
779 | &old->h, | 778 | &old->h, |
@@ -815,8 +814,8 @@ static int exp_set_key(svc_client *clp, int fsid_type, u32 *fsidv, | |||
815 | key.ek_client = clp; | 814 | key.ek_client = clp; |
816 | key.ek_fsidtype = fsid_type; | 815 | key.ek_fsidtype = fsid_type; |
817 | memcpy(key.ek_fsid, fsidv, key_len(fsid_type)); | 816 | memcpy(key.ek_fsid, fsidv, key_len(fsid_type)); |
818 | key.ek_mnt = exp->ex_mnt; | 817 | key.ek_mnt = exp->ex_path.mnt; |
819 | key.ek_dentry = exp->ex_dentry; | 818 | key.ek_dentry = exp->ex_path.dentry; |
820 | key.h.expiry_time = NEVER; | 819 | key.h.expiry_time = NEVER; |
821 | key.h.flags = 0; | 820 | key.h.flags = 0; |
822 | 821 | ||
@@ -870,8 +869,8 @@ static svc_export *exp_get_by_name(svc_client *clp, struct vfsmount *mnt, | |||
870 | return ERR_PTR(-ENOENT); | 869 | return ERR_PTR(-ENOENT); |
871 | 870 | ||
872 | key.ex_client = clp; | 871 | key.ex_client = clp; |
873 | key.ex_mnt = mnt; | 872 | key.ex_path.mnt = mnt; |
874 | key.ex_dentry = dentry; | 873 | key.ex_path.dentry = dentry; |
875 | 874 | ||
876 | exp = svc_export_lookup(&key); | 875 | exp = svc_export_lookup(&key); |
877 | if (exp == NULL) | 876 | if (exp == NULL) |
@@ -968,7 +967,7 @@ static int exp_fsid_hash(svc_client *clp, struct svc_export *exp) | |||
968 | static int exp_hash(struct auth_domain *clp, struct svc_export *exp) | 967 | static int exp_hash(struct auth_domain *clp, struct svc_export *exp) |
969 | { | 968 | { |
970 | u32 fsid[2]; | 969 | u32 fsid[2]; |
971 | struct inode *inode = exp->ex_dentry->d_inode; | 970 | struct inode *inode = exp->ex_path.dentry->d_inode; |
972 | dev_t dev = inode->i_sb->s_dev; | 971 | dev_t dev = inode->i_sb->s_dev; |
973 | 972 | ||
974 | if (old_valid_dev(dev)) { | 973 | if (old_valid_dev(dev)) { |
@@ -982,7 +981,7 @@ static int exp_hash(struct auth_domain *clp, struct svc_export *exp) | |||
982 | static void exp_unhash(struct svc_export *exp) | 981 | static void exp_unhash(struct svc_export *exp) |
983 | { | 982 | { |
984 | struct svc_expkey *ek; | 983 | struct svc_expkey *ek; |
985 | struct inode *inode = exp->ex_dentry->d_inode; | 984 | struct inode *inode = exp->ex_path.dentry->d_inode; |
986 | 985 | ||
987 | ek = exp_get_key(exp->ex_client, inode->i_sb->s_dev, inode->i_ino); | 986 | ek = exp_get_key(exp->ex_client, inode->i_sb->s_dev, inode->i_ino); |
988 | if (!IS_ERR(ek)) { | 987 | if (!IS_ERR(ek)) { |
@@ -1064,12 +1063,11 @@ exp_export(struct nfsctl_export *nxp) | |||
1064 | 1063 | ||
1065 | new.h.expiry_time = NEVER; | 1064 | new.h.expiry_time = NEVER; |
1066 | new.h.flags = 0; | 1065 | new.h.flags = 0; |
1067 | new.ex_path = kstrdup(nxp->ex_path, GFP_KERNEL); | 1066 | new.ex_pathname = kstrdup(nxp->ex_path, GFP_KERNEL); |
1068 | if (!new.ex_path) | 1067 | if (!new.ex_pathname) |
1069 | goto finish; | 1068 | goto finish; |
1070 | new.ex_client = clp; | 1069 | new.ex_client = clp; |
1071 | new.ex_mnt = nd.path.mnt; | 1070 | new.ex_path = nd.path; |
1072 | new.ex_dentry = nd.path.dentry; | ||
1073 | new.ex_flags = nxp->ex_flags; | 1071 | new.ex_flags = nxp->ex_flags; |
1074 | new.ex_anon_uid = nxp->ex_anon_uid; | 1072 | new.ex_anon_uid = nxp->ex_anon_uid; |
1075 | new.ex_anon_gid = nxp->ex_anon_gid; | 1073 | new.ex_anon_gid = nxp->ex_anon_gid; |
@@ -1090,8 +1088,7 @@ exp_export(struct nfsctl_export *nxp) | |||
1090 | } else | 1088 | } else |
1091 | err = 0; | 1089 | err = 0; |
1092 | finish: | 1090 | finish: |
1093 | if (new.ex_path) | 1091 | kfree(new.ex_pathname); |
1094 | kfree(new.ex_path); | ||
1095 | if (exp) | 1092 | if (exp) |
1096 | exp_put(exp); | 1093 | exp_put(exp); |
1097 | if (fsid_key && !IS_ERR(fsid_key)) | 1094 | if (fsid_key && !IS_ERR(fsid_key)) |
@@ -1360,7 +1357,7 @@ exp_pseudoroot(struct svc_rqst *rqstp, struct svc_fh *fhp) | |||
1360 | exp = rqst_exp_find(rqstp, FSID_NUM, fsidv); | 1357 | exp = rqst_exp_find(rqstp, FSID_NUM, fsidv); |
1361 | if (IS_ERR(exp)) | 1358 | if (IS_ERR(exp)) |
1362 | return nfserrno(PTR_ERR(exp)); | 1359 | return nfserrno(PTR_ERR(exp)); |
1363 | rv = fh_compose(fhp, exp, exp->ex_dentry, NULL); | 1360 | rv = fh_compose(fhp, exp, exp->ex_path.dentry, NULL); |
1364 | if (rv) | 1361 | if (rv) |
1365 | goto out; | 1362 | goto out; |
1366 | rv = check_nfsd_access(exp, rqstp); | 1363 | rv = check_nfsd_access(exp, rqstp); |
diff --git a/fs/nfsd/nfs3proc.c b/fs/nfsd/nfs3proc.c index eac82830bfd7..c721a1e6e9dd 100644 --- a/fs/nfsd/nfs3proc.c +++ b/fs/nfsd/nfs3proc.c | |||
@@ -67,7 +67,7 @@ nfsd3_proc_getattr(struct svc_rqst *rqstp, struct nfsd_fhandle *argp, | |||
67 | if (nfserr) | 67 | if (nfserr) |
68 | RETURN_STATUS(nfserr); | 68 | RETURN_STATUS(nfserr); |
69 | 69 | ||
70 | err = vfs_getattr(resp->fh.fh_export->ex_mnt, | 70 | err = vfs_getattr(resp->fh.fh_export->ex_path.mnt, |
71 | resp->fh.fh_dentry, &resp->stat); | 71 | resp->fh.fh_dentry, &resp->stat); |
72 | nfserr = nfserrno(err); | 72 | nfserr = nfserrno(err); |
73 | 73 | ||
diff --git a/fs/nfsd/nfs3xdr.c b/fs/nfsd/nfs3xdr.c index d7647f70e02b..17d0dd997204 100644 --- a/fs/nfsd/nfs3xdr.c +++ b/fs/nfsd/nfs3xdr.c | |||
@@ -218,7 +218,7 @@ encode_post_op_attr(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *fhp) | |||
218 | int err; | 218 | int err; |
219 | struct kstat stat; | 219 | struct kstat stat; |
220 | 220 | ||
221 | err = vfs_getattr(fhp->fh_export->ex_mnt, dentry, &stat); | 221 | err = vfs_getattr(fhp->fh_export->ex_path.mnt, dentry, &stat); |
222 | if (!err) { | 222 | if (!err) { |
223 | *p++ = xdr_one; /* attributes follow */ | 223 | *p++ = xdr_one; /* attributes follow */ |
224 | lease_get_mtime(dentry->d_inode, &stat.mtime); | 224 | lease_get_mtime(dentry->d_inode, &stat.mtime); |
@@ -270,7 +270,7 @@ void fill_post_wcc(struct svc_fh *fhp) | |||
270 | if (fhp->fh_post_saved) | 270 | if (fhp->fh_post_saved) |
271 | printk("nfsd: inode locked twice during operation.\n"); | 271 | printk("nfsd: inode locked twice during operation.\n"); |
272 | 272 | ||
273 | err = vfs_getattr(fhp->fh_export->ex_mnt, fhp->fh_dentry, | 273 | err = vfs_getattr(fhp->fh_export->ex_path.mnt, fhp->fh_dentry, |
274 | &fhp->fh_post_attr); | 274 | &fhp->fh_post_attr); |
275 | if (err) | 275 | if (err) |
276 | fhp->fh_post_saved = 0; | 276 | fhp->fh_post_saved = 0; |
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index b0592e7c378d..0e6a179eccaf 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c | |||
@@ -1330,9 +1330,9 @@ static char *nfsd4_path(struct svc_rqst *rqstp, struct svc_export *exp, __be32 * | |||
1330 | *stat = exp_pseudoroot(rqstp, &tmp_fh); | 1330 | *stat = exp_pseudoroot(rqstp, &tmp_fh); |
1331 | if (*stat) | 1331 | if (*stat) |
1332 | return NULL; | 1332 | return NULL; |
1333 | rootpath = tmp_fh.fh_export->ex_path; | 1333 | rootpath = tmp_fh.fh_export->ex_pathname; |
1334 | 1334 | ||
1335 | path = exp->ex_path; | 1335 | path = exp->ex_pathname; |
1336 | 1336 | ||
1337 | if (strncmp(path, rootpath, strlen(rootpath))) { | 1337 | if (strncmp(path, rootpath, strlen(rootpath))) { |
1338 | dprintk("nfsd: fs_locations failed;" | 1338 | dprintk("nfsd: fs_locations failed;" |
@@ -1481,7 +1481,7 @@ nfsd4_encode_fattr(struct svc_fh *fhp, struct svc_export *exp, | |||
1481 | goto out; | 1481 | goto out; |
1482 | } | 1482 | } |
1483 | 1483 | ||
1484 | err = vfs_getattr(exp->ex_mnt, dentry, &stat); | 1484 | err = vfs_getattr(exp->ex_path.mnt, dentry, &stat); |
1485 | if (err) | 1485 | if (err) |
1486 | goto out_nfserr; | 1486 | goto out_nfserr; |
1487 | if ((bmval0 & (FATTR4_WORD0_FILES_FREE | FATTR4_WORD0_FILES_TOTAL | | 1487 | if ((bmval0 & (FATTR4_WORD0_FILES_FREE | FATTR4_WORD0_FILES_TOTAL | |
@@ -1838,9 +1838,9 @@ out_acl: | |||
1838 | * and this is the root of a cross-mounted filesystem. | 1838 | * and this is the root of a cross-mounted filesystem. |
1839 | */ | 1839 | */ |
1840 | if (ignore_crossmnt == 0 && | 1840 | if (ignore_crossmnt == 0 && |
1841 | exp->ex_mnt->mnt_root->d_inode == dentry->d_inode) { | 1841 | exp->ex_path.mnt->mnt_root->d_inode == dentry->d_inode) { |
1842 | err = vfs_getattr(exp->ex_mnt->mnt_parent, | 1842 | err = vfs_getattr(exp->ex_path.mnt->mnt_parent, |
1843 | exp->ex_mnt->mnt_mountpoint, &stat); | 1843 | exp->ex_path.mnt->mnt_mountpoint, &stat); |
1844 | if (err) | 1844 | if (err) |
1845 | goto out_nfserr; | 1845 | goto out_nfserr; |
1846 | } | 1846 | } |
diff --git a/fs/nfsd/nfsfh.c b/fs/nfsd/nfsfh.c index 8fbd2dc08a92..0130b345234d 100644 --- a/fs/nfsd/nfsfh.c +++ b/fs/nfsd/nfsfh.c | |||
@@ -47,7 +47,7 @@ static int nfsd_acceptable(void *expv, struct dentry *dentry) | |||
47 | return 1; | 47 | return 1; |
48 | 48 | ||
49 | tdentry = dget(dentry); | 49 | tdentry = dget(dentry); |
50 | while (tdentry != exp->ex_dentry && ! IS_ROOT(tdentry)) { | 50 | while (tdentry != exp->ex_path.dentry && !IS_ROOT(tdentry)) { |
51 | /* make sure parents give x permission to user */ | 51 | /* make sure parents give x permission to user */ |
52 | int err; | 52 | int err; |
53 | parent = dget_parent(tdentry); | 53 | parent = dget_parent(tdentry); |
@@ -59,9 +59,9 @@ static int nfsd_acceptable(void *expv, struct dentry *dentry) | |||
59 | dput(tdentry); | 59 | dput(tdentry); |
60 | tdentry = parent; | 60 | tdentry = parent; |
61 | } | 61 | } |
62 | if (tdentry != exp->ex_dentry) | 62 | if (tdentry != exp->ex_path.dentry) |
63 | dprintk("nfsd_acceptable failed at %p %s\n", tdentry, tdentry->d_name.name); | 63 | dprintk("nfsd_acceptable failed at %p %s\n", tdentry, tdentry->d_name.name); |
64 | rv = (tdentry == exp->ex_dentry); | 64 | rv = (tdentry == exp->ex_path.dentry); |
65 | dput(tdentry); | 65 | dput(tdentry); |
66 | return rv; | 66 | return rv; |
67 | } | 67 | } |
@@ -209,9 +209,9 @@ fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, int access) | |||
209 | fileid_type = fh->fh_fileid_type; | 209 | fileid_type = fh->fh_fileid_type; |
210 | 210 | ||
211 | if (fileid_type == FILEID_ROOT) | 211 | if (fileid_type == FILEID_ROOT) |
212 | dentry = dget(exp->ex_dentry); | 212 | dentry = dget(exp->ex_path.dentry); |
213 | else { | 213 | else { |
214 | dentry = exportfs_decode_fh(exp->ex_mnt, fid, | 214 | dentry = exportfs_decode_fh(exp->ex_path.mnt, fid, |
215 | data_left, fileid_type, | 215 | data_left, fileid_type, |
216 | nfsd_acceptable, exp); | 216 | nfsd_acceptable, exp); |
217 | } | 217 | } |
@@ -299,7 +299,7 @@ out: | |||
299 | static void _fh_update(struct svc_fh *fhp, struct svc_export *exp, | 299 | static void _fh_update(struct svc_fh *fhp, struct svc_export *exp, |
300 | struct dentry *dentry) | 300 | struct dentry *dentry) |
301 | { | 301 | { |
302 | if (dentry != exp->ex_dentry) { | 302 | if (dentry != exp->ex_path.dentry) { |
303 | struct fid *fid = (struct fid *) | 303 | struct fid *fid = (struct fid *) |
304 | (fhp->fh_handle.fh_auth + fhp->fh_handle.fh_size/4 - 1); | 304 | (fhp->fh_handle.fh_auth + fhp->fh_handle.fh_size/4 - 1); |
305 | int maxsize = (fhp->fh_maxsize - fhp->fh_handle.fh_size)/4; | 305 | int maxsize = (fhp->fh_maxsize - fhp->fh_handle.fh_size)/4; |
@@ -344,12 +344,12 @@ fh_compose(struct svc_fh *fhp, struct svc_export *exp, struct dentry *dentry, | |||
344 | struct inode * inode = dentry->d_inode; | 344 | struct inode * inode = dentry->d_inode; |
345 | struct dentry *parent = dentry->d_parent; | 345 | struct dentry *parent = dentry->d_parent; |
346 | __u32 *datap; | 346 | __u32 *datap; |
347 | dev_t ex_dev = exp->ex_dentry->d_inode->i_sb->s_dev; | 347 | dev_t ex_dev = exp->ex_path.dentry->d_inode->i_sb->s_dev; |
348 | int root_export = (exp->ex_dentry == exp->ex_dentry->d_sb->s_root); | 348 | int root_export = (exp->ex_path.dentry == exp->ex_path.dentry->d_sb->s_root); |
349 | 349 | ||
350 | dprintk("nfsd: fh_compose(exp %02x:%02x/%ld %s/%s, ino=%ld)\n", | 350 | dprintk("nfsd: fh_compose(exp %02x:%02x/%ld %s/%s, ino=%ld)\n", |
351 | MAJOR(ex_dev), MINOR(ex_dev), | 351 | MAJOR(ex_dev), MINOR(ex_dev), |
352 | (long) exp->ex_dentry->d_inode->i_ino, | 352 | (long) exp->ex_path.dentry->d_inode->i_ino, |
353 | parent->d_name.name, dentry->d_name.name, | 353 | parent->d_name.name, dentry->d_name.name, |
354 | (inode ? inode->i_ino : 0)); | 354 | (inode ? inode->i_ino : 0)); |
355 | 355 | ||
@@ -391,7 +391,7 @@ fh_compose(struct svc_fh *fhp, struct svc_export *exp, struct dentry *dentry, | |||
391 | /* FALL THROUGH */ | 391 | /* FALL THROUGH */ |
392 | case FSID_MAJOR_MINOR: | 392 | case FSID_MAJOR_MINOR: |
393 | case FSID_ENCODE_DEV: | 393 | case FSID_ENCODE_DEV: |
394 | if (!(exp->ex_dentry->d_inode->i_sb->s_type->fs_flags | 394 | if (!(exp->ex_path.dentry->d_inode->i_sb->s_type->fs_flags |
395 | & FS_REQUIRES_DEV)) | 395 | & FS_REQUIRES_DEV)) |
396 | goto retry; | 396 | goto retry; |
397 | break; | 397 | break; |
@@ -454,7 +454,7 @@ fh_compose(struct svc_fh *fhp, struct svc_export *exp, struct dentry *dentry, | |||
454 | fhp->fh_handle.ofh_dev = old_encode_dev(ex_dev); | 454 | fhp->fh_handle.ofh_dev = old_encode_dev(ex_dev); |
455 | fhp->fh_handle.ofh_xdev = fhp->fh_handle.ofh_dev; | 455 | fhp->fh_handle.ofh_xdev = fhp->fh_handle.ofh_dev; |
456 | fhp->fh_handle.ofh_xino = | 456 | fhp->fh_handle.ofh_xino = |
457 | ino_t_to_u32(exp->ex_dentry->d_inode->i_ino); | 457 | ino_t_to_u32(exp->ex_path.dentry->d_inode->i_ino); |
458 | fhp->fh_handle.ofh_dirino = ino_t_to_u32(parent_ino(dentry)); | 458 | fhp->fh_handle.ofh_dirino = ino_t_to_u32(parent_ino(dentry)); |
459 | if (inode) | 459 | if (inode) |
460 | _fh_update_old(dentry, exp, &fhp->fh_handle); | 460 | _fh_update_old(dentry, exp, &fhp->fh_handle); |
@@ -465,7 +465,7 @@ fh_compose(struct svc_fh *fhp, struct svc_export *exp, struct dentry *dentry, | |||
465 | datap = fhp->fh_handle.fh_auth+0; | 465 | datap = fhp->fh_handle.fh_auth+0; |
466 | fhp->fh_handle.fh_fsid_type = fsid_type; | 466 | fhp->fh_handle.fh_fsid_type = fsid_type; |
467 | mk_fsid(fsid_type, datap, ex_dev, | 467 | mk_fsid(fsid_type, datap, ex_dev, |
468 | exp->ex_dentry->d_inode->i_ino, | 468 | exp->ex_path.dentry->d_inode->i_ino, |
469 | exp->ex_fsid, exp->ex_uuid); | 469 | exp->ex_fsid, exp->ex_uuid); |
470 | 470 | ||
471 | len = key_len(fsid_type); | 471 | len = key_len(fsid_type); |
@@ -571,7 +571,7 @@ enum fsid_source fsid_source(struct svc_fh *fhp) | |||
571 | case FSID_DEV: | 571 | case FSID_DEV: |
572 | case FSID_ENCODE_DEV: | 572 | case FSID_ENCODE_DEV: |
573 | case FSID_MAJOR_MINOR: | 573 | case FSID_MAJOR_MINOR: |
574 | if (fhp->fh_export->ex_dentry->d_inode->i_sb->s_type->fs_flags | 574 | if (fhp->fh_export->ex_path.dentry->d_inode->i_sb->s_type->fs_flags |
575 | & FS_REQUIRES_DEV) | 575 | & FS_REQUIRES_DEV) |
576 | return FSIDSOURCE_DEV; | 576 | return FSIDSOURCE_DEV; |
577 | break; | 577 | break; |
diff --git a/fs/nfsd/nfsproc.c b/fs/nfsd/nfsproc.c index 977a71f64e19..6cfc96a12483 100644 --- a/fs/nfsd/nfsproc.c +++ b/fs/nfsd/nfsproc.c | |||
@@ -41,7 +41,7 @@ static __be32 | |||
41 | nfsd_return_attrs(__be32 err, struct nfsd_attrstat *resp) | 41 | nfsd_return_attrs(__be32 err, struct nfsd_attrstat *resp) |
42 | { | 42 | { |
43 | if (err) return err; | 43 | if (err) return err; |
44 | return nfserrno(vfs_getattr(resp->fh.fh_export->ex_mnt, | 44 | return nfserrno(vfs_getattr(resp->fh.fh_export->ex_path.mnt, |
45 | resp->fh.fh_dentry, | 45 | resp->fh.fh_dentry, |
46 | &resp->stat)); | 46 | &resp->stat)); |
47 | } | 47 | } |
@@ -49,7 +49,7 @@ static __be32 | |||
49 | nfsd_return_dirop(__be32 err, struct nfsd_diropres *resp) | 49 | nfsd_return_dirop(__be32 err, struct nfsd_diropres *resp) |
50 | { | 50 | { |
51 | if (err) return err; | 51 | if (err) return err; |
52 | return nfserrno(vfs_getattr(resp->fh.fh_export->ex_mnt, | 52 | return nfserrno(vfs_getattr(resp->fh.fh_export->ex_path.mnt, |
53 | resp->fh.fh_dentry, | 53 | resp->fh.fh_dentry, |
54 | &resp->stat)); | 54 | &resp->stat)); |
55 | } | 55 | } |
@@ -164,7 +164,7 @@ nfsd_proc_read(struct svc_rqst *rqstp, struct nfsd_readargs *argp, | |||
164 | &resp->count); | 164 | &resp->count); |
165 | 165 | ||
166 | if (nfserr) return nfserr; | 166 | if (nfserr) return nfserr; |
167 | return nfserrno(vfs_getattr(resp->fh.fh_export->ex_mnt, | 167 | return nfserrno(vfs_getattr(resp->fh.fh_export->ex_path.mnt, |
168 | resp->fh.fh_dentry, | 168 | resp->fh.fh_dentry, |
169 | &resp->stat)); | 169 | &resp->stat)); |
170 | } | 170 | } |
diff --git a/fs/nfsd/nfsxdr.c b/fs/nfsd/nfsxdr.c index 61ad61743d94..afd08e2c90a5 100644 --- a/fs/nfsd/nfsxdr.c +++ b/fs/nfsd/nfsxdr.c | |||
@@ -207,7 +207,7 @@ encode_fattr(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *fhp, | |||
207 | __be32 *nfs2svc_encode_fattr(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *fhp) | 207 | __be32 *nfs2svc_encode_fattr(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *fhp) |
208 | { | 208 | { |
209 | struct kstat stat; | 209 | struct kstat stat; |
210 | vfs_getattr(fhp->fh_export->ex_mnt, fhp->fh_dentry, &stat); | 210 | vfs_getattr(fhp->fh_export->ex_path.mnt, fhp->fh_dentry, &stat); |
211 | return encode_fattr(rqstp, p, fhp, &stat); | 211 | return encode_fattr(rqstp, p, fhp, &stat); |
212 | } | 212 | } |
213 | 213 | ||
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index cc75e4fcd02b..46f59d5365a0 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c | |||
@@ -101,7 +101,7 @@ nfsd_cross_mnt(struct svc_rqst *rqstp, struct dentry **dpp, | |||
101 | { | 101 | { |
102 | struct svc_export *exp = *expp, *exp2 = NULL; | 102 | struct svc_export *exp = *expp, *exp2 = NULL; |
103 | struct dentry *dentry = *dpp; | 103 | struct dentry *dentry = *dpp; |
104 | struct vfsmount *mnt = mntget(exp->ex_mnt); | 104 | struct vfsmount *mnt = mntget(exp->ex_path.mnt); |
105 | struct dentry *mounts = dget(dentry); | 105 | struct dentry *mounts = dget(dentry); |
106 | int err = 0; | 106 | int err = 0; |
107 | 107 | ||
@@ -156,15 +156,15 @@ nfsd_lookup_dentry(struct svc_rqst *rqstp, struct svc_fh *fhp, | |||
156 | if (isdotent(name, len)) { | 156 | if (isdotent(name, len)) { |
157 | if (len==1) | 157 | if (len==1) |
158 | dentry = dget(dparent); | 158 | dentry = dget(dparent); |
159 | else if (dparent != exp->ex_dentry) { | 159 | else if (dparent != exp->ex_path.dentry) |
160 | dentry = dget_parent(dparent); | 160 | dentry = dget_parent(dparent); |
161 | } else if (!EX_NOHIDE(exp)) | 161 | else if (!EX_NOHIDE(exp)) |
162 | dentry = dget(dparent); /* .. == . just like at / */ | 162 | dentry = dget(dparent); /* .. == . just like at / */ |
163 | else { | 163 | else { |
164 | /* checking mountpoint crossing is very different when stepping up */ | 164 | /* checking mountpoint crossing is very different when stepping up */ |
165 | struct svc_export *exp2 = NULL; | 165 | struct svc_export *exp2 = NULL; |
166 | struct dentry *dp; | 166 | struct dentry *dp; |
167 | struct vfsmount *mnt = mntget(exp->ex_mnt); | 167 | struct vfsmount *mnt = mntget(exp->ex_path.mnt); |
168 | dentry = dget(dparent); | 168 | dentry = dget(dparent); |
169 | while(dentry == mnt->mnt_root && follow_up(&mnt, &dentry)) | 169 | while(dentry == mnt->mnt_root && follow_up(&mnt, &dentry)) |
170 | ; | 170 | ; |
@@ -721,7 +721,8 @@ nfsd_open(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, | |||
721 | 721 | ||
722 | DQUOT_INIT(inode); | 722 | DQUOT_INIT(inode); |
723 | } | 723 | } |
724 | *filp = dentry_open(dget(dentry), mntget(fhp->fh_export->ex_mnt), flags); | 724 | *filp = dentry_open(dget(dentry), mntget(fhp->fh_export->ex_path.mnt), |
725 | flags); | ||
725 | if (IS_ERR(*filp)) | 726 | if (IS_ERR(*filp)) |
726 | host_err = PTR_ERR(*filp); | 727 | host_err = PTR_ERR(*filp); |
727 | out_nfserr: | 728 | out_nfserr: |
@@ -1462,7 +1463,7 @@ nfsd_readlink(struct svc_rqst *rqstp, struct svc_fh *fhp, char *buf, int *lenp) | |||
1462 | if (!inode->i_op || !inode->i_op->readlink) | 1463 | if (!inode->i_op || !inode->i_op->readlink) |
1463 | goto out; | 1464 | goto out; |
1464 | 1465 | ||
1465 | touch_atime(fhp->fh_export->ex_mnt, dentry); | 1466 | touch_atime(fhp->fh_export->ex_path.mnt, dentry); |
1466 | /* N.B. Why does this call need a get_fs()?? | 1467 | /* N.B. Why does this call need a get_fs()?? |
1467 | * Remove the set_fs and watch the fireworks:-) --okir | 1468 | * Remove the set_fs and watch the fireworks:-) --okir |
1468 | */ | 1469 | */ |
diff --git a/include/linux/nfsd/export.h b/include/linux/nfsd/export.h index 3a1687251367..491dec1e37ca 100644 --- a/include/linux/nfsd/export.h +++ b/include/linux/nfsd/export.h | |||
@@ -84,9 +84,8 @@ struct svc_export { | |||
84 | struct cache_head h; | 84 | struct cache_head h; |
85 | struct auth_domain * ex_client; | 85 | struct auth_domain * ex_client; |
86 | int ex_flags; | 86 | int ex_flags; |
87 | struct vfsmount * ex_mnt; | 87 | struct path ex_path; |
88 | struct dentry * ex_dentry; | 88 | char *ex_pathname; |
89 | char * ex_path; | ||
90 | uid_t ex_anon_uid; | 89 | uid_t ex_anon_uid; |
91 | gid_t ex_anon_gid; | 90 | gid_t ex_anon_gid; |
92 | int ex_fsid; | 91 | int ex_fsid; |