aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2020-10-27 23:17:18 +0000
committerJens Axboe <axboe@kernel.dk>2020-12-09 12:03:59 -0700
commit018043be1f1bc43ad6956bfd39b7beea12fb4ca6 (patch)
tree4f30e614a08a8d43ea48def4c5bab1c7f868c77b
parentio_uring: add support for IORING_OP_UNLINKAT (diff)
downloadwireguard-linux-018043be1f1bc43ad6956bfd39b7beea12fb4ca6.tar.xz
wireguard-linux-018043be1f1bc43ad6956bfd39b7beea12fb4ca6.zip
io_uring: split poll and poll_remove structs
Don't use a single struct for polls and poll remove requests, they have totally different layouts. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to '')
-rw-r--r--fs/io_uring.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c
index c8ecbc0bd286..10cfb6d17994 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -395,16 +395,18 @@ struct io_ring_ctx {
*/
struct io_poll_iocb {
struct file *file;
- union {
- struct wait_queue_head *head;
- u64 addr;
- };
+ struct wait_queue_head *head;
__poll_t events;
bool done;
bool canceled;
struct wait_queue_entry wait;
};
+struct io_poll_remove {
+ struct file *file;
+ u64 addr;
+};
+
struct io_close {
struct file *file;
struct file *put_file;
@@ -672,6 +674,7 @@ struct io_kiocb {
struct file *file;
struct io_rw rw;
struct io_poll_iocb poll;
+ struct io_poll_remove poll_remove;
struct io_accept accept;
struct io_sync sync;
struct io_cancel cancel;
@@ -5538,7 +5541,7 @@ static int io_poll_remove_prep(struct io_kiocb *req,
sqe->poll_events)
return -EINVAL;
- req->poll.addr = READ_ONCE(sqe->addr);
+ req->poll_remove.addr = READ_ONCE(sqe->addr);
return 0;
}
@@ -5549,12 +5552,10 @@ static int io_poll_remove_prep(struct io_kiocb *req,
static int io_poll_remove(struct io_kiocb *req)
{
struct io_ring_ctx *ctx = req->ctx;
- u64 addr;
int ret;
- addr = req->poll.addr;
spin_lock_irq(&ctx->completion_lock);
- ret = io_poll_cancel(ctx, addr);
+ ret = io_poll_cancel(ctx, req->poll_remove.addr);
spin_unlock_irq(&ctx->completion_lock);
if (ret < 0)