• Ming Lei's avatar
    io_uring: cancelable uring_cmd · 93b8cc60
    Ming Lei authored
    uring_cmd may never complete, such as ublk, in which uring cmd isn't
    completed until one new block request is coming from ublk block device.
    
    Add cancelable uring_cmd to provide mechanism to driver for cancelling
    pending commands in its own way.
    
    Add API of io_uring_cmd_mark_cancelable() for driver to mark one command as
    cancelable, then io_uring will cancel this command in
    io_uring_cancel_generic(). ->uring_cmd() callback is reused for canceling
    command in driver's way, then driver gets notified with the cancelling
    from io_uring.
    
    Add API of io_uring_cmd_get_task() to help driver cancel handler
    deal with the canceling.
    Reviewed-by: default avatarGabriel Krisman Bertazi <krisman@suse.de>
    Suggested-by: default avatarJens Axboe <axboe@kernel.dk>
    Signed-off-by: default avatarMing Lei <ming.lei@redhat.com>
    Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
    93b8cc60
uring_cmd.c 6.34 KB