Commit 3c85cc43 authored by Jens Axboe's avatar Jens Axboe

Revert "io_uring/rsrc: disallow multi-source reg buffers"

This reverts commit edd47826.

There's really no specific need to disallow multiple sources of buffers,
and io_uring really should not be mandating this by itself. We should
be able to solely rely on GUP making these decisions.

As this also stands in the way of a cleanup where io_uring is the odd
one out, kill it.

Link: https://lore.kernel.org/all/61ded378-51a8-1dcb-b631-fda1903248a9@gmail.com/Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent ea97f6c8
...@@ -1053,17 +1053,14 @@ struct page **io_pin_pages(unsigned long ubuf, unsigned long len, int *npages) ...@@ -1053,17 +1053,14 @@ struct page **io_pin_pages(unsigned long ubuf, unsigned long len, int *npages)
pret = pin_user_pages(ubuf, nr_pages, FOLL_WRITE | FOLL_LONGTERM, pret = pin_user_pages(ubuf, nr_pages, FOLL_WRITE | FOLL_LONGTERM,
pages, vmas); pages, vmas);
if (pret == nr_pages) { if (pret == nr_pages) {
struct file *file = vmas[0]->vm_file;
/* don't support file backed memory */ /* don't support file backed memory */
for (i = 0; i < nr_pages; i++) { for (i = 0; i < nr_pages; i++) {
if (vmas[i]->vm_file != file) { struct vm_area_struct *vma = vmas[i];
ret = -EINVAL;
break; if (vma_is_shmem(vma))
}
if (!file)
continue; continue;
if (!vma_is_shmem(vmas[i]) && !is_file_hugepages(file)) { if (vma->vm_file &&
!is_file_hugepages(vma->vm_file)) {
ret = -EOPNOTSUPP; ret = -EOPNOTSUPP;
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment