diff options
author | Pavel Begunkov <asml.silence@gmail.com> | 2020-06-15 09:24:04 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2020-06-15 16:51:34 +0200 |
commit | 44e728b8aae0bb6d4229129083974f9dea43f50b (patch) | |
tree | 0b34f50ac8706d4c8d9ee801bf680ea06a27e10c /fs/io-wq.c | |
parent | io-wq: add an option to cancel all matched reqs (diff) | |
download | linux-44e728b8aae0bb6d4229129083974f9dea43f50b.tar.xz linux-44e728b8aae0bb6d4229129083974f9dea43f50b.zip |
io_uring: cancel all task's requests on exit
If a process is going away, io_uring_flush() will cancel only 1
request with a matching pid. Cancel all of them
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/io-wq.c')
-rw-r--r-- | fs/io-wq.c | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/fs/io-wq.c b/fs/io-wq.c index e290202d6f64..47c5f3aeb460 100644 --- a/fs/io-wq.c +++ b/fs/io-wq.c @@ -1018,20 +1018,6 @@ enum io_wq_cancel io_wq_cancel_work(struct io_wq *wq, struct io_wq_work *cwork) return io_wq_cancel_cb(wq, io_wq_io_cb_cancel_data, (void *)cwork, false); } -static bool io_wq_pid_match(struct io_wq_work *work, void *data) -{ - pid_t pid = (pid_t) (unsigned long) data; - - return work->task_pid == pid; -} - -enum io_wq_cancel io_wq_cancel_pid(struct io_wq *wq, pid_t pid) -{ - void *data = (void *) (unsigned long) pid; - - return io_wq_cancel_cb(wq, io_wq_pid_match, data, false); -} - struct io_wq *io_wq_create(unsigned bounded, struct io_wq_data *data) { int ret = -ENOMEM, node; |