io_uring/memmap: reuse io_free_region for failure path
authorPavel Begunkov <asml.silence@gmail.com>
Fri, 29 Nov 2024 13:34:27 +0000 (13:34 +0000)
committerJens Axboe <axboe@kernel.dk>
Mon, 16 Dec 2024 13:58:14 +0000 (06:58 -0700)
commit94315400344adb88d765808de99a128fc8b6f00d
tree0c33357644173c7e667a922cfab0f9c7b11329db
parent728db59a9911eb34644a397ff6b0b94b55f775c0
io_uring/memmap: reuse io_free_region for failure path

Regions are going to become more complex with allocation options and
optimisations, I want to split initialisation into steps and for that it
needs a sane fail path. Reuse io_free_region(), it's smart enough to
undo only what's needed and leaves the structure in a consistent state.

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