diff options
author | Jens Axboe <axboe@kernel.dk> | 2020-02-08 19:16:39 -0700 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2020-02-09 09:55:38 -0700 |
commit | 36282881a795cbf717aca79392ae9cdf0fef59c9 (patch) | |
tree | 246026127aff05485eccefbe84def6e58f1174ba /fs/io-wq.h | |
parent | 00bcda13dcbf6bf7fa6f2a5886dd555362de8cfa (diff) |
io-wq: add io_wq_cancel_pid() to cancel based on a specific pid
Add a helper that allows the caller to cancel work based on what mm
it belongs to. This allows io_uring to cancel work from a given
task or thread when it exits.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/io-wq.h')
-rw-r--r-- | fs/io-wq.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/io-wq.h b/fs/io-wq.h index f152ba677d8f..ccc7d84af57d 100644 --- a/fs/io-wq.h +++ b/fs/io-wq.h @@ -76,6 +76,7 @@ struct io_wq_work { const struct cred *creds; struct fs_struct *fs; unsigned flags; + pid_t task_pid; }; #define INIT_IO_WORK(work, _func) \ @@ -109,6 +110,7 @@ void io_wq_flush(struct io_wq *wq); void io_wq_cancel_all(struct io_wq *wq); enum io_wq_cancel io_wq_cancel_work(struct io_wq *wq, struct io_wq_work *cwork); +enum io_wq_cancel io_wq_cancel_pid(struct io_wq *wq, pid_t pid); typedef bool (work_cancel_fn)(struct io_wq_work *, void *); |