Skip to content

Commit

Permalink
NFS: Clean ups in fs/nfs/direct.c
Browse files Browse the repository at this point in the history
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
  • Loading branch information
Chuck Lever authored and Trond Myklebust committed Jul 11, 2007
1 parent 4eb6bf6 commit 070ea60
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions fs/nfs/direct.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -814,7 +812,7 @@ ssize_t nfs_file_direct_read(struct kiocb *iocb, const struct iovec *iov,
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 */
Expand All @@ -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)
Expand Down

0 comments on commit 070ea60

Please sign in to comment.