aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2007-05-19 17:22:52 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2007-07-10 23:40:23 -0400
commit070ea60214c1894c9eec86ca9aa5dff57a5ab525 (patch)
treeee77da93e0faa6a893d8ad6dacaf1943de7ffbae
parent4eb6bf6bfb580afaf1e1a1d30cba17a078530cf4 (diff)
NFS: Clean ups in fs/nfs/direct.c
Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r--fs/nfs/direct.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c
index 00eee87510fe..4c97e55e86ee 100644
--- a/fs/nfs/direct.c
+++ b/fs/nfs/direct.c
@@ -763,10 +763,8 @@ ssize_t nfs_file_direct_read(struct kiocb *iocb, const struct iovec *iov,
763 (unsigned long) count, (long long) pos); 763 (unsigned long) count, (long long) pos);
764 764
765 if (nr_segs != 1) 765 if (nr_segs != 1)
766 return -EINVAL;
767
768 if (count < 0)
769 goto out; 766 goto out;
767
770 retval = -EFAULT; 768 retval = -EFAULT;
771 if (!access_ok(VERIFY_WRITE, buf, count)) 769 if (!access_ok(VERIFY_WRITE, buf, count))
772 goto out; 770 goto out;
@@ -814,7 +812,7 @@ out:
814ssize_t nfs_file_direct_write(struct kiocb *iocb, const struct iovec *iov, 812ssize_t nfs_file_direct_write(struct kiocb *iocb, const struct iovec *iov,
815 unsigned long nr_segs, loff_t pos) 813 unsigned long nr_segs, loff_t pos)
816{ 814{
817 ssize_t retval; 815 ssize_t retval = -EINVAL;
818 struct file *file = iocb->ki_filp; 816 struct file *file = iocb->ki_filp;
819 struct address_space *mapping = file->f_mapping; 817 struct address_space *mapping = file->f_mapping;
820 /* XXX: temporary */ 818 /* XXX: temporary */
@@ -827,7 +825,7 @@ ssize_t nfs_file_direct_write(struct kiocb *iocb, const struct iovec *iov,
827 (unsigned long) count, (long long) pos); 825 (unsigned long) count, (long long) pos);
828 826
829 if (nr_segs != 1) 827 if (nr_segs != 1)
830 return -EINVAL; 828 goto out;
831 829
832 retval = generic_write_checks(file, &pos, &count, 0); 830 retval = generic_write_checks(file, &pos, &count, 0);
833 if (retval) 831 if (retval)