diff options
author | Pavel Begunkov <asml.silence@gmail.com> | 2022-07-12 21:52:47 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2022-07-24 18:41:07 -0600 |
commit | 63809137ebb58f0aa2ce359117422686e3304f45 (patch) | |
tree | 769dd9e570105c3dc48a193800610358d1450166 /io_uring/notif.h | |
parent | 10c7d33ecd51619e453cf6aeee8e326f8ba5cfea (diff) | |
download | linux-63809137ebb58f0aa2ce359117422686e3304f45.tar.gz linux-63809137ebb58f0aa2ce359117422686e3304f45.tar.bz2 linux-63809137ebb58f0aa2ce359117422686e3304f45.zip |
io_uring: flush notifiers after sendzc
Allow to flush notifiers as a part of sendzc request by setting
IORING_SENDZC_FLUSH flag. When the sendzc request succeedes it will
flush the used [active] notifier.
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/e0b4d9a6797e2fd6092824fe42953db7a519bbc8.1657643355.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring/notif.h')
-rw-r--r-- | io_uring/notif.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/io_uring/notif.h b/io_uring/notif.h index 00efe164bdc4..6cd73d7b965b 100644 --- a/io_uring/notif.h +++ b/io_uring/notif.h @@ -54,6 +54,7 @@ int io_notif_register(struct io_ring_ctx *ctx, int io_notif_unregister(struct io_ring_ctx *ctx); void io_notif_cache_purge(struct io_ring_ctx *ctx); +void io_notif_slot_flush(struct io_notif_slot *slot); struct io_notif *io_alloc_notif(struct io_ring_ctx *ctx, struct io_notif_slot *slot); @@ -74,3 +75,13 @@ static inline struct io_notif_slot *io_get_notif_slot(struct io_ring_ctx *ctx, idx = array_index_nospec(idx, ctx->nr_notif_slots); return &ctx->notif_slots[idx]; } + +static inline void io_notif_slot_flush_submit(struct io_notif_slot *slot, + unsigned int issue_flags) +{ + if (!(issue_flags & IO_URING_F_UNLOCKED)) { + slot->notif->task = current; + io_get_task_refs(1); + } + io_notif_slot_flush(slot); +} |