else if (!success && !nd->zc_copied)
WRITE_ONCE(nd->zc_copied, true);
}
- io_tx_ubuf_complete(skb, uarg, success);
+
+ if (!refcount_dec_and_test(&uarg->refcnt))
+ return;
+
+ notif->io_task_work.func = io_notif_tw_complete;
+ __io_req_task_work_add(notif, IOU_F_TWQ_LAZY_WAKE);
}
-static const struct ubuf_info_ops io_ubuf_ops_ext = {
- .complete = io_tx_ubuf_callback_ext,
-};
-
-void io_notif_set_extended(struct io_kiocb *notif)
-{
- struct io_notif_data *nd = io_notif_to_data(notif);
-
- if (nd->uarg.ops != &io_ubuf_ops_ext) {
- nd->account_pages = 0;
- nd->zc_report = false;
- nd->zc_used = false;
- nd->zc_copied = false;
- nd->uarg.ops = &io_ubuf_ops_ext;
- notif->io_task_work.func = io_notif_complete_tw_ext;
- }
-}
-
+ static const struct ubuf_info_ops io_ubuf_ops = {
+ .complete = io_tx_ubuf_complete,
+ };
+
struct io_kiocb *io_alloc_notif(struct io_ring_ctx *ctx)
__must_hold(&ctx->uring_lock)
{
notif->task = current;
io_get_task_refs(1);
notif->rsrc_node = NULL;
- notif->io_task_work.func = io_req_task_complete;
nd = io_notif_to_data(notif);
+ nd->zc_report = false;
+ nd->account_pages = 0;
nd->uarg.flags = IO_NOTIF_UBUF_FLAGS;
- nd->uarg.callback = io_tx_ubuf_callback;
+ nd->uarg.ops = &io_ubuf_ops;
refcount_set(&nd->uarg.refcnt, 1);
return notif;
}