Commit 9bb4ebc6 authored by Neil Brown's avatar Neil Brown Committed by David S. Miller

[PATCH] kNFSd 10: Discard ex_dev and ex_ino from svc_export

They can be deduced from ex_dentry
parent d42f5634
......@@ -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);
......
......@@ -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) {
......
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment