linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] switch knfsd to vfs_read/vfs_write
  2002-10-15  4:21 [PATCH] switch knfsd to vfs_read/vfs_write Christoph Hellwig
@ 2002-10-15  3:14 ` Neil Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Neil Brown @ 2002-10-15  3:14 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: linux-kernel

On Tuesday October 15, hch@sgi.com wrote:
> Switch knfsd to vfs_read/vfs_write to work on aio-only filesystems.
> This also gets stuff like the LSM checks and mandatory lock checking
> for free.
> 

Thanks.  I'll pass it on.

NeilBrown

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH] switch knfsd to vfs_read/vfs_write
@ 2002-10-15  4:21 Christoph Hellwig
  2002-10-15  3:14 ` Neil Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Christoph Hellwig @ 2002-10-15  4:21 UTC (permalink / raw)
  To: Neil Brown; +Cc: linux-kernel

Switch knfsd to vfs_read/vfs_write to work on aio-only filesystems.
This also gets stuff like the LSM checks and mandatory lock checking
for free.


diff -uNr -p linux-2.5.40-mm1/fs/nfsd/vfs.c linux/fs/nfsd/vfs.c
--- linux-2.5.40-mm1/fs/nfsd/vfs.c	Tue Oct  1 14:23:50 2002
+++ linux/fs/nfsd/vfs.c	Tue Oct  1 14:53:37 2002
@@ -585,8 +585,6 @@ nfsd_read(struct svc_rqst *rqstp, struct
 	if (err)
 		goto out;
 	err = nfserr_perm;
-	if (!file.f_op->read)
-		goto out_close;
 	inode = file.f_dentry->d_inode;
 #ifdef MSNFS
 	if ((fhp->fh_export->ex_flags & NFSEXP_MSNFS) &&
@@ -598,11 +596,10 @@ nfsd_read(struct svc_rqst *rqstp, struct
 	ra = nfsd_get_raparms(inode->i_dev, inode->i_ino);
 	if (ra)
 		file.f_ra = ra->p_ra;
-	file.f_pos = offset;
 
 	oldfs = get_fs();
 	set_fs(KERNEL_DS);
-	err = file.f_op->read(&file, buf, *count, &file.f_pos);
+	err = vfs_read(&file, buf, *count, &offset);
 	set_fs(oldfs);
 
 	/* Write back readahead params */
@@ -644,8 +641,7 @@ nfsd_write(struct svc_rqst *rqstp, struc
 	if (!cnt)
 		goto out_close;
 	err = nfserr_perm;
-	if (!file.f_op->write)
-		goto out_close;
+
 #ifdef MSNFS
 	if ((fhp->fh_export->ex_flags & NFSEXP_MSNFS) &&
 		(!lock_may_write(file.f_dentry->d_inode, offset, cnt)))
@@ -675,11 +671,9 @@ nfsd_write(struct svc_rqst *rqstp, struc
 	if (stable && !EX_WGATHER(exp))
 		file.f_flags |= O_SYNC;
 
-	file.f_pos = offset;		/* set write offset */
-
 	/* Write the data. */
 	oldfs = get_fs(); set_fs(KERNEL_DS);
-	err = file.f_op->write(&file, buf, cnt, &file.f_pos);
+	err = vfs_write(&file, buf, cnt, &offset);
 	if (err >= 0)
 		nfsdstats.io_write += cnt;
 	set_fs(oldfs);

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-10-15  3:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-15  4:21 [PATCH] switch knfsd to vfs_read/vfs_write Christoph Hellwig
2002-10-15  3:14 ` Neil Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).