public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCHSET for-next 0/2] tctx setup cleanups
@ 2026-04-08 19:24 Jens Axboe
  2026-04-08 19:24 ` [PATCH 1/2] io_uring/tctx: have io_uring_alloc_task_context() return tctx Jens Axboe
  2026-04-08 19:24 ` [PATCH 2/2] io_uring/tctx: clean up __io_uring_add_tctx_node() error handling Jens Axboe
  0 siblings, 2 replies; 3+ messages in thread
From: Jens Axboe @ 2026-04-08 19:24 UTC (permalink / raw)
  To: io-uring

Hi,

It's a bit annoying how io_uring_alloc_task_context() automatically
assigns tsk->io_uring, when callers later may have paths that fail.
This is fine because task cleanup deals with whatever state that
->io_uring may be in, but it would be cleaner to have it either be
assigned if it's fully setup, or not assigned at all. These 2 patches
do that by having io_uring_alloc_task_context() return the context
rather than implicitly assigning it inside the task being passed. The
caller must instead assign it to the task, when any operation that can
fail has been completed.

No functional changes intended in this series, strictly a cleanup

 io_uring/sqpoll.c |  8 ++++-
 io_uring/tctx.c   | 77 +++++++++++++++++++++++++++++------------------
 io_uring/tctx.h   |  4 +--
 3 files changed, 57 insertions(+), 32 deletions(-)

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-04-08 19:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-08 19:24 [PATCHSET for-next 0/2] tctx setup cleanups Jens Axboe
2026-04-08 19:24 ` [PATCH 1/2] io_uring/tctx: have io_uring_alloc_task_context() return tctx Jens Axboe
2026-04-08 19:24 ` [PATCH 2/2] io_uring/tctx: clean up __io_uring_add_tctx_node() error handling Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox