• Pavel Begunkov's avatar
    io_uring: follow **iovec idiom in io_import_iovec · 252917c3
    Pavel Begunkov authored
    As for import_iovec(), return !=NULL iovec from io_import_iovec() only
    when it should be freed. That includes returning NULL when iovec is
    already in req->io, because it should be deallocated by other means,
    e.g. inside op handler. After io_setup_async_rw() local iovec to ->io,
    just mark it NULL, to follow the idea in io_{read,write} as well.
    
    That's easier to follow, and especially useful if we want to reuse
    per-op space for completion data.
    Signed-off-by: default avatarPavel Begunkov <asml.silence@gmail.com>
    [axboe: only call kfree() on non-NULL pointer]
    Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
    252917c3
io_uring.c 203 KB