Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

io_uring: remove task ref helpers

They are only used right where they are defined, just open-code them
inside io_put_task().

Signed-off-by: Jens Axboe <axboe@kernel.dk>

+10 -21
+10 -21
io_uring/io_uring.c
··· 677 677 mutex_unlock(&ctx->uring_lock); 678 678 } 679 679 680 - /* can be called by any task */ 681 - static void io_put_task_remote(struct task_struct *task) 682 - { 683 - struct io_uring_task *tctx = task->io_uring; 684 - 685 - percpu_counter_sub(&tctx->inflight, 1); 686 - if (unlikely(atomic_read(&tctx->in_cancel))) 687 - wake_up(&tctx->wait); 688 - put_task_struct(task); 689 - } 690 - 691 - /* used by a task to put its own references */ 692 - static void io_put_task_local(struct task_struct *task) 693 - { 694 - task->io_uring->cached_refs++; 695 - } 696 - 697 680 /* must to be called somewhat shortly after putting a request */ 698 681 static inline void io_put_task(struct task_struct *task) 699 682 { 700 - if (likely(task == current)) 701 - io_put_task_local(task); 702 - else 703 - io_put_task_remote(task); 683 + struct io_uring_task *tctx = task->io_uring; 684 + 685 + if (likely(task == current)) { 686 + tctx->cached_refs++; 687 + } else { 688 + percpu_counter_sub(&tctx->inflight, 1); 689 + if (unlikely(atomic_read(&tctx->in_cancel))) 690 + wake_up(&tctx->wait); 691 + put_task_struct(task); 692 + } 704 693 } 705 694 706 695 void io_task_refs_refill(struct io_uring_task *tctx)