diff options
| author | Neil Brown <neilb@cse.unsw.edu.au> | 2002-09-12 01:41:52 -0700 |
|---|---|---|
| committer | David S. Miller <davem@nuts.ninka.net> | 2002-09-12 01:41:52 -0700 |
| commit | 9bb4ebc66db89c3312b66956ee1975da0d7bdef6 (patch) | |
| tree | 687a5562444c4b65d68ebd9a84e9fc5e2cbb2cad | |
| parent | d42f56348b97fa01e99b9306ab41325728fe7863 (diff) | |
[PATCH] kNFSd 10: Discard ex_dev and ex_ino from svc_export
They can be deduced from ex_dentry
| -rw-r--r-- | fs/nfsd/export.c | 16 | ||||
| -rw-r--r-- | fs/nfsd/nfsfh.c | 12 | ||||
| -rw-r--r-- | include/linux/nfsd/export.h | 2 |
3 files changed, 14 insertions, 16 deletions
diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c index 003e13d1c82c..23db25732740 100644 --- a/fs/nfsd/export.c +++ b/fs/nfsd/export.c @@ -70,15 +70,17 @@ static svc_client * clients; svc_export * exp_get(svc_client *clp, dev_t dev, ino_t ino) { - struct list_head *head, *p; - + struct list_head *head; + svc_export *exp; + if (!clp) return NULL; head = &clp->cl_export[EXPORT_HASH(dev)]; - list_for_each(p, head) { - svc_export *exp = list_entry(p, svc_export, ex_hash); - if (exp->ex_ino == ino && exp->ex_dev == dev) + list_for_each_entry(exp, head, ex_hash) { + struct inode *inode = exp->ex_dentry->d_inode; + if (inode->i_ino == ino && + inode->i_sb->s_dev == dev) return exp; } return NULL; @@ -338,8 +340,6 @@ exp_export(struct nfsctl_export *nxp) exp->ex_mnt = mntget(nd.mnt); exp->ex_dentry = dget(nd.dentry); exp->ex_flags = nxp->ex_flags; - exp->ex_dev = dev; - exp->ex_ino = ino; exp->ex_anon_uid = nxp->ex_anon_uid; exp->ex_anon_gid = nxp->ex_anon_gid; exp->ex_fsid = nxp->ex_dev; @@ -376,8 +376,6 @@ exp_do_unexport(svc_export *unexp) dentry = unexp->ex_dentry; mnt = unexp->ex_mnt; inode = dentry->d_inode; - if (unexp->ex_dev != inode->i_sb->s_dev || unexp->ex_ino != inode->i_ino) - printk(KERN_WARNING "nfsd: bad dentry in unexport!\n"); dput(dentry); mntput(mnt); diff --git a/fs/nfsd/nfsfh.c b/fs/nfsd/nfsfh.c index 5d3c98be3696..1539b2682490 100644 --- a/fs/nfsd/nfsfh.c +++ b/fs/nfsd/nfsfh.c @@ -322,9 +322,11 @@ fh_compose(struct svc_fh *fhp, struct svc_export *exp, struct dentry *dentry, st struct inode * inode = dentry->d_inode; struct dentry *parent = dentry->d_parent; __u32 *datap; + dev_t ex_dev = exp->ex_dentry->d_inode->i_sb->s_dev; dprintk("nfsd: fh_compose(exp %02x:%02x/%ld %s/%s, ino=%ld)\n", - MAJOR(exp->ex_dev), MINOR(exp->ex_dev), (long) exp->ex_ino, + MAJOR(ex_dev), MINOR(ex_dev), + (long) exp->ex_dentry->d_inode->i_ino, parent->d_name.name, dentry->d_name.name, (inode ? inode->i_ino : 0)); @@ -351,9 +353,9 @@ fh_compose(struct svc_fh *fhp, struct svc_export *exp, struct dentry *dentry, st memset(&fhp->fh_handle.fh_base, 0, NFS_FHSIZE); fhp->fh_handle.fh_size = NFS_FHSIZE; fhp->fh_handle.ofh_dcookie = 0xfeebbaca; - fhp->fh_handle.ofh_dev = htonl((MAJOR(exp->ex_dev)<<16)| MINOR(exp->ex_dev)); + fhp->fh_handle.ofh_dev = htonl((MAJOR(ex_dev)<<16)| MINOR(ex_dev)); fhp->fh_handle.ofh_xdev = fhp->fh_handle.ofh_dev; - fhp->fh_handle.ofh_xino = ino_t_to_u32(exp->ex_ino); + fhp->fh_handle.ofh_xino = ino_t_to_u32(exp->ex_dentry->d_inode->i_ino); fhp->fh_handle.ofh_dirino = ino_t_to_u32(parent_ino(dentry)); if (inode) _fh_update_old(dentry, exp, &fhp->fh_handle); @@ -370,8 +372,8 @@ fh_compose(struct svc_fh *fhp, struct svc_export *exp, struct dentry *dentry, st } else { fhp->fh_handle.fh_fsid_type = 0; /* fsid_type 0 == 2byte major, 2byte minor, 4byte inode */ - *datap++ = htonl((MAJOR(exp->ex_dev)<<16)| MINOR(exp->ex_dev)); - *datap++ = ino_t_to_u32(exp->ex_ino); + *datap++ = htonl((MAJOR(ex_dev)<<16)| MINOR(ex_dev)); + *datap++ = ino_t_to_u32(exp->ex_dentry->d_inode->i_ino); fhp->fh_handle.fh_size = 3*4; } if (inode) { diff --git a/include/linux/nfsd/export.h b/include/linux/nfsd/export.h index 654e97e5e875..4b3f7b1bfd74 100644 --- a/include/linux/nfsd/export.h +++ b/include/linux/nfsd/export.h @@ -64,8 +64,6 @@ struct svc_export { int ex_flags; struct vfsmount * ex_mnt; struct dentry * ex_dentry; - dev_t ex_dev; - ino_t ex_ino; uid_t ex_anon_uid; gid_t ex_anon_gid; int ex_fsid; |
