diff options
| -rw-r--r-- | fs/aio.c | 18 |
1 files changed, 1 insertions, 17 deletions
| @@ -1376,21 +1376,6 @@ static int aio_setup_vectored_rw(int rw, char __user *buf, size_t len, | |||
| 1376 | return 0; | 1376 | return 0; |
| 1377 | } | 1377 | } |
| 1378 | 1378 | ||
| 1379 | static int aio_setup_single_vector(int rw, char __user *buf, size_t len, | ||
| 1380 | struct iovec *iovec, | ||
| 1381 | struct iov_iter *iter) | ||
| 1382 | { | ||
| 1383 | if (len > MAX_RW_COUNT) | ||
| 1384 | len = MAX_RW_COUNT; | ||
| 1385 | if (unlikely(!access_ok(!rw, buf, len))) | ||
| 1386 | return -EFAULT; | ||
| 1387 | |||
| 1388 | iovec->iov_base = buf; | ||
| 1389 | iovec->iov_len = len; | ||
| 1390 | iov_iter_init(iter, rw, iovec, 1, len); | ||
| 1391 | return 0; | ||
| 1392 | } | ||
| 1393 | |||
| 1394 | /* | 1379 | /* |
| 1395 | * aio_run_iocb: | 1380 | * aio_run_iocb: |
| 1396 | * Performs the initial checks and io submission. | 1381 | * Performs the initial checks and io submission. |
| @@ -1434,8 +1419,7 @@ rw_common: | |||
| 1434 | ret = aio_setup_vectored_rw(rw, buf, len, | 1419 | ret = aio_setup_vectored_rw(rw, buf, len, |
| 1435 | &iovec, compat, &iter); | 1420 | &iovec, compat, &iter); |
| 1436 | else | 1421 | else |
| 1437 | ret = aio_setup_single_vector(rw, buf, len, | 1422 | ret = import_single_range(rw, buf, len, iovec, &iter); |
| 1438 | iovec, &iter); | ||
| 1439 | if (!ret) | 1423 | if (!ret) |
| 1440 | ret = rw_verify_area(rw, file, &req->ki_pos, | 1424 | ret = rw_verify_area(rw, file, &req->ki_pos, |
| 1441 | iov_iter_count(&iter)); | 1425 | iov_iter_count(&iter)); |
