diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-06-19 22:45:37 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-06-19 22:45:37 +0000 |
commit | 6d403070f28cd44860fdb3a53be5da0275c65cf4 (patch) | |
tree | 0d0e7fe7b5fb7568d19e11d7d862b77a866ce081 /fs/nfsd | |
parent | ecf1bf5f6c2e668d03b0a9fb026db7aa41e292e1 (diff) |
Merge with 2.4.0-test1-ac21 + pile of MIPS cleanups to make merging
possible. Chainsawed RM200 kernel to compile again. Jazz machine
status unknown.
Diffstat (limited to 'fs/nfsd')
-rw-r--r-- | fs/nfsd/export.c | 3 | ||||
-rw-r--r-- | fs/nfsd/nfs3proc.c | 2 | ||||
-rw-r--r-- | fs/nfsd/nfs3xdr.c | 14 | ||||
-rw-r--r-- | fs/nfsd/nfsfh.c | 2 | ||||
-rw-r--r-- | fs/nfsd/nfssvc.c | 5 | ||||
-rw-r--r-- | fs/nfsd/nfsxdr.c | 8 | ||||
-rw-r--r-- | fs/nfsd/vfs.c | 28 |
7 files changed, 26 insertions, 36 deletions
diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c index b674d1e95..dee52dd8a 100644 --- a/fs/nfsd/export.c +++ b/fs/nfsd/export.c @@ -430,13 +430,12 @@ exp_rootfh(struct svc_client *clp, kdev_t dev, ino_t ino, * fh must be initialized before calling fh_compose */ fh_init(&fh, maxsize); - if (fh_compose(&fh, exp, nd.dentry)) + if (fh_compose(&fh, exp, dget(nd.dentry))) err = -EINVAL; else err = 0; memcpy(f, &fh.fh_handle, sizeof(struct knfsd_fh)); fh_put(&fh); - return err; out: path_release(&nd); diff --git a/fs/nfsd/nfs3proc.c b/fs/nfsd/nfs3proc.c index 8f69cb53e..e6118a967 100644 --- a/fs/nfsd/nfs3proc.c +++ b/fs/nfsd/nfs3proc.c @@ -658,7 +658,7 @@ struct svc_procedure nfsd_procedures3[22] = { PROC(mknod, mknod, create, fhandle2, RC_REPLBUFF), PROC(remove, dirop, wccstat, fhandle, RC_REPLBUFF), PROC(rmdir, dirop, wccstat, fhandle, RC_REPLBUFF), - PROC(rename, rename, rename, fhandle, RC_REPLBUFF), + PROC(rename, rename, rename, fhandle2, RC_REPLBUFF), PROC(link, link, link, fhandle2, RC_REPLBUFF), PROC(readdir, readdir, readdir, fhandle, RC_NOCACHE), PROC(readdirplus,readdirplus, readdir, fhandle, RC_NOCACHE), diff --git a/fs/nfsd/nfs3xdr.c b/fs/nfsd/nfs3xdr.c index 97acf317e..948566a6e 100644 --- a/fs/nfsd/nfs3xdr.c +++ b/fs/nfsd/nfs3xdr.c @@ -698,17 +698,9 @@ encode_entry(struct readdir_cd *cd, const char *name, cd->eob = 1; return -EINVAL; } - *p++ = xdr_one; /* mark entry present */ - p = xdr_encode_hyper(p, ino); /* file id */ - p[slen - 1] = 0; /* don't leak kernel data */ -#ifdef XDR_ENCODE_STRING_TAKES_LENGTH - p = xdr_encode_string(p, name, namlen); /* name length & name */ -#else - /* just like nfsproc.c */ - *p++ = htonl((u32) namlen); - memcpy(p, name, namlen); - p += slen; -#endif + *p++ = xdr_one; /* mark entry present */ + p = xdr_encode_hyper(p, ino); /* file id */ + p = xdr_encode_array(p, name, namlen);/* name length & name */ cd->offset = p; /* remember pointer */ p = xdr_encode_hyper(p, NFS_OFFSET_MAX); /* offset of next entry */ diff --git a/fs/nfsd/nfsfh.c b/fs/nfsd/nfsfh.c index f88161593..85a98c874 100644 --- a/fs/nfsd/nfsfh.c +++ b/fs/nfsd/nfsfh.c @@ -142,7 +142,7 @@ static struct dentry *nfsd_iget(struct super_block *sb, unsigned long ino, __u32 /* we didn't find the right inode.. */ dprintk("fh_verify: Inode %lu, Bad count: %d %d or version %u %u\n", inode->i_ino, - inode->i_nlink, inode->i_count, + inode->i_nlink, atomic_read(&inode->i_count), inode->i_generation, generation); diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c index fb3b32f8d..a2b2b4971 100644 --- a/fs/nfsd/nfssvc.c +++ b/fs/nfsd/nfssvc.c @@ -83,7 +83,10 @@ nfsd_svc(unsigned short port, int nrservs) if (error < 0) goto failure; -#if 0 /* Don't even pretend that TCP works. It doesn't. */ +#if CONFIG_NFSD_TCP + /* This is developer-only at the moment, + * there are untracked bugs as of 2.4.0-test1-ac11 + */ error = svc_makesock(nfsd_serv, IPPROTO_TCP, port); if (error < 0) goto failure; diff --git a/fs/nfsd/nfsxdr.c b/fs/nfsd/nfsxdr.c index 2984f0330..7b9546d93 100644 --- a/fs/nfsd/nfsxdr.c +++ b/fs/nfsd/nfsxdr.c @@ -412,11 +412,9 @@ nfssvc_encode_entry(struct readdir_cd *cd, const char *name, cd->eob = 1; return -EINVAL; } - *p++ = xdr_one; /* mark entry present */ - *p++ = htonl((u32) ino); /* file id */ - *p++ = htonl((u32) namlen); /* name length & name */ - memcpy(p, name, namlen); - p += slen; + *p++ = xdr_one; /* mark entry present */ + *p++ = htonl((u32) ino); /* file id */ + p = xdr_encode_array(p, name, namlen);/* name length & name */ cd->offset = p; /* remember pointer */ *p++ = ~(u32) 0; /* offset of next entry */ diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index 1110e0938..601549ccc 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c @@ -30,6 +30,8 @@ #include <linux/unistd.h> #include <linux/malloc.h> #include <linux/in.h> +#define __NO_VERSION__ +#include <linux/module.h> #include <linux/sunrpc/svc.h> #include <linux/nfsd/nfsd.h> @@ -312,7 +314,7 @@ nfsd_setattr(struct svc_rqst *rqstp, struct svc_fh *fhp, struct iattr *iap) if (err) goto out_nfserr; if (EX_ISSYNC(fhp->fh_export)) - write_inode_now(inode); + write_inode_now(inode, 0); err = 0; /* Don't unlock inode; the nfssvc_release functions are supposed @@ -451,7 +453,7 @@ nfsd_open(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, goto out_nfserr; memset(filp, 0, sizeof(*filp)); - filp->f_op = inode->i_fop; + filp->f_op = fops_get(inode->i_fop); atomic_set(&filp->f_count, 1); filp->f_dentry = dentry; if (access & MAY_WRITE) { @@ -467,6 +469,7 @@ nfsd_open(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, if (filp->f_op && filp->f_op->open) { err = filp->f_op->open(inode, filp); if (err) { + fops_put(filp->f_op); if (access & MAY_WRITE) put_write_access(inode); @@ -492,16 +495,11 @@ nfsd_close(struct file *filp) struct dentry *dentry = filp->f_dentry; struct inode *inode = dentry->d_inode; - if (!inode->i_count) - printk(KERN_WARNING "nfsd: inode count == 0!\n"); - if (!dentry->d_count) - printk(KERN_WARNING "nfsd: wheee, %s/%s d_count == 0!\n", - dentry->d_parent->d_name.name, dentry->d_name.name); if (filp->f_op && filp->f_op->release) filp->f_op->release(inode, filp); - if (filp->f_mode & FMODE_WRITE) { + fops_put(filp->f_op); + if (filp->f_mode & FMODE_WRITE) put_write_access(inode); - } } /* @@ -514,7 +512,7 @@ nfsd_sync(struct file *filp) { dprintk("nfsd: sync file %s\n", filp->f_dentry->d_name.name); down(&filp->f_dentry->d_inode->i_sem); - filp->f_op->fsync(filp, filp->f_dentry); + filp->f_op->fsync(filp, filp->f_dentry,0); up(&filp->f_dentry->d_inode->i_sem); } @@ -522,10 +520,10 @@ void nfsd_sync_dir(struct dentry *dp) { struct inode *inode = dp->d_inode; - int (*fsync) (struct file *, struct dentry *); + int (*fsync) (struct file *, struct dentry *, int); if (inode->i_fop && (fsync = inode->i_fop->fsync)) { - fsync(NULL, dp); + fsync(NULL, dp, 0); } } @@ -893,7 +891,7 @@ nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp, if (EX_ISSYNC(fhp->fh_export)) { nfsd_sync_dir(dentry); - write_inode_now(dchild->d_inode); + write_inode_now(dchild->d_inode, 0); } @@ -1120,7 +1118,7 @@ nfsd_symlink(struct svc_rqst *rqstp, struct svc_fh *fhp, | S_IFLNK; err = notify_change(dnew, iap); if (!err && EX_ISSYNC(fhp->fh_export)) - write_inode_now(dentry->d_inode); + write_inode_now(dentry->d_inode, 0); } } } else @@ -1180,7 +1178,7 @@ nfsd_link(struct svc_rqst *rqstp, struct svc_fh *ffhp, if (!err) { if (EX_ISSYNC(ffhp->fh_export)) { nfsd_sync_dir(ddir); - write_inode_now(dest); + write_inode_now(dest, 0); } } else { if (err == -EXDEV && rqstp->rq_vers == 2) |