diff options
author | Pavel Begunkov <asml.silence@gmail.com> | 2024-11-29 13:34:39 +0000 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2024-12-23 08:17:16 -0700 |
commit | 7cd7b9575270e4c4f80cc5ff71b13f4102b59b9e (patch) | |
tree | 4fee061979c1c21fc125819e40b4f340bad397ea /io_uring/kbuf.c | |
parent | ef62de3c4ad58fab4e37bc267177bc723e48e5e2 (diff) |
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>
Diffstat (limited to 'io_uring/kbuf.c')
-rw-r--r-- | io_uring/kbuf.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/io_uring/kbuf.c b/io_uring/kbuf.c index 2dfb9f9419a0..e91260a6156b 100644 --- a/io_uring/kbuf.c +++ b/io_uring/kbuf.c @@ -748,8 +748,5 @@ struct io_mapped_region *io_pbuf_get_region(struct io_ring_ctx *ctx, bl = xa_load(&ctx->io_bl_xa, bgid); if (!bl || !(bl->flags & IOBL_BUF_RING)) return NULL; - if (WARN_ON_ONCE(!io_region_is_set(&bl->region))) - return NULL; - return &bl->region; } |