summaryrefslogtreecommitdiffstats
path: root/fs/nfsd
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-04-19 04:00:00 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-04-19 04:00:00 +0000
commit46e045034336a2cc90c1798cd7cc07af744ddfd6 (patch)
tree3b9b51fc482e729f663d25333e77fbed9aaa939a /fs/nfsd
parent31dc59d503a02e84c4de98826452acaeb56dc15a (diff)
Merge with Linux 2.3.99-pre4.
Diffstat (limited to 'fs/nfsd')
-rw-r--r--fs/nfsd/export.c7
-rw-r--r--fs/nfsd/lockd.c3
-rw-r--r--fs/nfsd/nfs3xdr.c11
-rw-r--r--fs/nfsd/nfsctl.c1
-rw-r--r--fs/nfsd/vfs.c47
5 files changed, 29 insertions, 40 deletions
diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c
index c6ea9074c..53bfa0bea 100644
--- a/fs/nfsd/export.c
+++ b/fs/nfsd/export.c
@@ -246,14 +246,11 @@ exp_export(struct nfsctl_export *nxp)
/* Look up the dentry */
err = -EINVAL;
- dentry = lookup_dentry(nxp->ex_path, NULL, 0);
+ dentry = lookup_dentry(nxp->ex_path, LOOKUP_POSITIVE);
if (IS_ERR(dentry))
goto out_unlock;
- err = -ENOENT;
inode = dentry->d_inode;
- if (!inode)
- goto finish;
err = -EINVAL;
if (inode->i_dev != dev || inode->i_ino != nxp->ex_ino) {
printk(KERN_DEBUG "exp_export: i_dev = %x, dev = %x\n",
@@ -443,7 +440,7 @@ exp_rootfh(struct svc_client *clp, kdev_t dev, ino_t ino,
err = -EPERM;
if (path) {
- if (!(dentry = lookup_dentry(path, NULL, 0))) {
+ if (!(dentry = lookup_dentry(path, 0))) {
printk("nfsd: exp_rootfh path not found %s", path);
return -EPERM;
}
diff --git a/fs/nfsd/lockd.c b/fs/nfsd/lockd.c
index c45d494ba..e15483e43 100644
--- a/fs/nfsd/lockd.c
+++ b/fs/nfsd/lockd.c
@@ -27,7 +27,8 @@ nlm_fopen(struct svc_rqst *rqstp, struct nfs_fh *f, struct file *filp)
/* must initialize before using! but maxsize doesn't matter */
fh_init(&fh,0);
- memcpy((char*)&fh.fh_handle.fh_base, (char*)f, NFS_FHSIZE);
+ fh.fh_handle.fh_size = f->size;
+ memcpy((char*)&fh.fh_handle.fh_base, f->data, f->size);
fh.fh_export = NULL;
nfserr = nfsd_open(rqstp, &fh, S_IFREG, MAY_LOCK, filp);
diff --git a/fs/nfsd/nfs3xdr.c b/fs/nfsd/nfs3xdr.c
index 969ff54a9..61ee94a3e 100644
--- a/fs/nfsd/nfs3xdr.c
+++ b/fs/nfsd/nfs3xdr.c
@@ -74,22 +74,11 @@ decode_fh(u32 *p, struct svc_fh *fhp)
static inline u32 *
encode_fh(u32 *p, struct svc_fh *fhp)
{
-#if 0
int size = fhp->fh_handle.fh_size;
*p++ = htonl(size);
if (size) p[XDR_QUADLEN(size)-1]=0;
memcpy(p, &fhp->fh_handle.fh_base, size);
return p + XDR_QUADLEN(size);
-#else
- /* until locked knows about var-length file handles,
- * we always return NFS_FHSIZE handles
- */
- int size = fhp->fh_handle.fh_size;
- *p++ = htonl(NFS_FHSIZE);
- memset(p, 0, NFS_FHSIZE);
- memcpy(p, &fhp->fh_handle.fh_base, size);
- return p + XDR_QUADLEN(NFS_FHSIZE);
-#endif
}
/*
diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
index 97b46f0c7..65c70164a 100644
--- a/fs/nfsd/nfsctl.c
+++ b/fs/nfsd/nfsctl.c
@@ -130,7 +130,6 @@ nfsctl_getfs(struct nfsctl_fsparm *data, struct knfsd_fh *res)
else
err = exp_rootfh(clp, 0, 0, data->gd_path, res, data->gd_maxlen);
exp_unlock();
- /*HACK*/ res->fh_size = NFS_FHSIZE; /* HACK until lockd handles var-length handles */
return err;
}
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index 5cd55fda8..56da94aea 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -91,7 +91,8 @@ nfsd_lookup(struct svc_rqst *rqstp, struct svc_fh *fhp, const char *name,
int len, struct svc_fh *resfh)
{
struct svc_export *exp;
- struct dentry *dparent, *dchild;
+ struct dentry *dparent;
+ struct nameidata nd;
int err;
dprintk("nfsd: nfsd_lookup(fh %s, %s)\n", SVCFH_fmt(fhp), name);
@@ -116,49 +117,51 @@ nfsd_lookup(struct svc_rqst *rqstp, struct svc_fh *fhp, const char *name,
/* checking mountpoint crossing is very different when stepping up */
if (dparent == exp->ex_dentry) {
if (!EX_CROSSMNT(exp))
- dchild = dget(dparent); /* .. == . just like at / */
+ nd.dentry = dget(dparent); /* .. == . just like at / */
else
{
struct svc_export *exp2 = NULL;
struct dentry *dp;
- dchild = dparent->d_covers->d_parent;
- for (dp=dchild;
+ nd.dentry = dparent->d_covers->d_parent;
+ for (dp=nd.dentry;
exp2 == NULL && dp->d_covers->d_parent != dp;
dp=dp->d_covers->d_parent)
exp2 = exp_get(exp->ex_client, dp->d_inode->i_dev, dp->d_inode->i_ino);
- if (exp2==NULL || dchild->d_sb != exp2->ex_dentry->d_sb) {
- dchild = dget(dparent);
+ if (exp2==NULL || nd.dentry->d_sb != exp2->ex_dentry->d_sb) {
+ nd.dentry = dget(dparent);
} else {
- dget(dchild);
+ dget(nd.dentry);
exp = exp2;
}
}
} else
- dchild = dget(dparent->d_parent);
+ nd.dentry = dget(dparent->d_parent);
} else {
- dchild = lookup_dentry(name, dget(dparent), 0);
- if (IS_ERR(dchild))
+ nd.mnt = NULL;
+ nd.dentry = dget(dparent);
+ err = walk_name(name, 0, &nd);
+ if (err)
goto out_nfserr;
/*
* check if we have crossed a mount point ...
*/
- if (dchild->d_sb != dparent->d_sb) {
+ if (nd.dentry->d_sb != dparent->d_sb) {
struct svc_export *exp2 = NULL;
exp2 = exp_get(rqstp->rq_client,
- dchild->d_inode->i_dev,
- dchild->d_inode->i_ino);
+ nd.dentry->d_inode->i_dev,
+ nd.dentry->d_inode->i_ino);
if (exp2 && EX_CROSSMNT(exp2))
/* successfully crossed mount point */
exp = exp2;
- else if (dchild->d_covers->d_sb == dparent->d_sb) {
+ else if (nd.dentry->d_covers->d_sb == dparent->d_sb) {
/* stay in the original filesystem */
- struct dentry *tdentry = dget(dchild->d_covers);
- dput(dchild);
- dchild = tdentry;
+ struct dentry *tdentry = dget(nd.dentry->d_covers);
+ dput(nd.dentry);
+ nd.dentry = tdentry;
} else {
/* This cannot possibly happen */
- printk("nfsd_lookup: %s/%s impossible mount point!\n", dparent->d_name.name, dchild->d_name.name);
- dput(dchild);
+ printk("nfsd_lookup: %s/%s impossible mount point!\n", dparent->d_name.name, nd.dentry->d_name.name);
+ dput(nd.dentry);
err = nfserr_acces;
goto out;
@@ -169,14 +172,14 @@ nfsd_lookup(struct svc_rqst *rqstp, struct svc_fh *fhp, const char *name,
* Note: we compose the file handle now, but as the
* dentry may be negative, it may need to be updated.
*/
- err = fh_compose(resfh, exp, dchild);
- if (!err && !dchild->d_inode)
+ err = fh_compose(resfh, exp, nd.dentry);
+ if (!err && !nd.dentry->d_inode)
err = nfserr_noent;
out:
return err;
out_nfserr:
- err = nfserrno(PTR_ERR(dchild));
+ err = nfserrno(err);
goto out;
}