mirror of https://gitee.com/openkylin/linux.git
kill aio_setup_single_vector()
identical to import_single_range() Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
36e9f6535f
commit
d4fb392f4c
18
fs/aio.c
18
fs/aio.c
|
@ -1376,21 +1376,6 @@ static int aio_setup_vectored_rw(int rw, char __user *buf, size_t len,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int aio_setup_single_vector(int rw, char __user *buf, size_t len,
|
|
||||||
struct iovec *iovec,
|
|
||||||
struct iov_iter *iter)
|
|
||||||
{
|
|
||||||
if (len > MAX_RW_COUNT)
|
|
||||||
len = MAX_RW_COUNT;
|
|
||||||
if (unlikely(!access_ok(!rw, buf, len)))
|
|
||||||
return -EFAULT;
|
|
||||||
|
|
||||||
iovec->iov_base = buf;
|
|
||||||
iovec->iov_len = len;
|
|
||||||
iov_iter_init(iter, rw, iovec, 1, len);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* aio_run_iocb:
|
* aio_run_iocb:
|
||||||
* Performs the initial checks and io submission.
|
* Performs the initial checks and io submission.
|
||||||
|
@ -1434,8 +1419,7 @@ static ssize_t aio_run_iocb(struct kiocb *req, unsigned opcode,
|
||||||
ret = aio_setup_vectored_rw(rw, buf, len,
|
ret = aio_setup_vectored_rw(rw, buf, len,
|
||||||
&iovec, compat, &iter);
|
&iovec, compat, &iter);
|
||||||
else
|
else
|
||||||
ret = aio_setup_single_vector(rw, buf, len,
|
ret = import_single_range(rw, buf, len, iovec, &iter);
|
||||||
iovec, &iter);
|
|
||||||
if (!ret)
|
if (!ret)
|
||||||
ret = rw_verify_area(rw, file, &req->ki_pos,
|
ret = rw_verify_area(rw, file, &req->ki_pos,
|
||||||
iov_iter_count(&iter));
|
iov_iter_count(&iter));
|
||||||
|
|
Loading…
Reference in New Issue