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>
This commit is contained in:
parent
4eb6bf6bfb
commit
070ea60214
|
@ -763,10 +763,8 @@ ssize_t nfs_file_direct_read(struct kiocb *iocb, const struct iovec *iov,
|
||||||
(unsigned long) count, (long long) pos);
|
(unsigned long) count, (long long) pos);
|
||||||
|
|
||||||
if (nr_segs != 1)
|
if (nr_segs != 1)
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
if (count < 0)
|
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
retval = -EFAULT;
|
retval = -EFAULT;
|
||||||
if (!access_ok(VERIFY_WRITE, buf, count))
|
if (!access_ok(VERIFY_WRITE, buf, count))
|
||||||
goto out;
|
goto out;
|
||||||
|
@ -814,7 +812,7 @@ out:
|
||||||
ssize_t nfs_file_direct_write(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)
|
unsigned long nr_segs, loff_t pos)
|
||||||
{
|
{
|
||||||
ssize_t retval;
|
ssize_t retval = -EINVAL;
|
||||||
struct file *file = iocb->ki_filp;
|
struct file *file = iocb->ki_filp;
|
||||||
struct address_space *mapping = file->f_mapping;
|
struct address_space *mapping = file->f_mapping;
|
||||||
/* XXX: temporary */
|
/* 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);
|
(unsigned long) count, (long long) pos);
|
||||||
|
|
||||||
if (nr_segs != 1)
|
if (nr_segs != 1)
|
||||||
return -EINVAL;
|
goto out;
|
||||||
|
|
||||||
retval = generic_write_checks(file, &pos, &count, 0);
|
retval = generic_write_checks(file, &pos, &count, 0);
|
||||||
if (retval)
|
if (retval)
|
||||||
|
|
Loading…
Reference in New Issue