io_uring/memmap: unify io_uring mmap'ing code
authorPavel Begunkov <asml.silence@gmail.com>
Fri, 29 Nov 2024 13:34:39 +0000 (13:34 +0000)
committerJens Axboe <axboe@kernel.dk>
Mon, 16 Dec 2024 13:58:14 +0000 (06:58 -0700)
commit8fbddda6771304b48d668094cdd7a23865ffe2df
tree50b425209a13c195922aaf33d28e9546199d0f4a
parent18c8986d93befe9b64c9ab9cd2f6c91039ba0bac
io_uring/memmap: unify io_uring mmap'ing code

All mapped memory is now backed by regions and we can unify and clean
up io_region_validate_mmap() and io_uring_mmap(). Extract a function
looking up a region, the rest of the handling should be generic and just
needs the region.

There is one more ring type specific code, i.e. the mmaping size
truncation quirk for IORING_OFF_[S,C]Q_RING, which is left as is.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/f5e1eda1562bfd34276de07465525ae5f10e1e84.1732886067.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/kbuf.c
io_uring/memmap.c