switch knfsd to vfs_read/vfs_write
PATCH 1/1 switch knfsd to vfs_read/vfs_write
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.
fs/nfsd/vfs.c +3 -9
@@ -585,8 +585,6 @@ nfsd_read(struct svc_rqst *rqstp, structif (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, strucif (!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, strucif (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);
Quoted 4 lines · On Tuesday October 15, [email protected] 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