diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2007-05-19 17:22:52 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2007-07-10 23:40:23 -0400 |
commit | 070ea60214c1894c9eec86ca9aa5dff57a5ab525 (patch) | |
tree | ee77da93e0faa6a893d8ad6dacaf1943de7ffbae /fs/nfs/direct.c | |
parent | 4eb6bf6bfb580afaf1e1a1d30cba17a078530cf4 (diff) | |
download | linux-3.10-070ea60214c1894c9eec86ca9aa5dff57a5ab525.tar.gz linux-3.10-070ea60214c1894c9eec86ca9aa5dff57a5ab525.tar.bz2 linux-3.10-070ea60214c1894c9eec86ca9aa5dff57a5ab525.zip |
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>
Diffstat (limited to 'fs/nfs/direct.c')
-rw-r--r-- | fs/nfs/direct.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c index 00eee87510f..4c97e55e86e 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, (unsigned long) count, (long long) pos); if (nr_segs != 1) - return -EINVAL; - - if (count < 0) goto out; + retval = -EFAULT; if (!access_ok(VERIFY_WRITE, buf, count)) goto out; @@ -814,7 +812,7 @@ out: ssize_t nfs_file_direct_write(struct kiocb *iocb, const struct iovec *iov, unsigned long nr_segs, loff_t pos) { - ssize_t retval; + ssize_t retval = -EINVAL; struct file *file = iocb->ki_filp; struct address_space *mapping = file->f_mapping; /* XXX: temporary */ @@ -827,7 +825,7 @@ ssize_t nfs_file_direct_write(struct kiocb *iocb, const struct iovec *iov, (unsigned long) count, (long long) pos); if (nr_segs != 1) - return -EINVAL; + goto out; retval = generic_write_checks(file, &pos, &count, 0); if (retval) |