File tree Expand file tree Collapse file tree 1 file changed +10
-21
lines changed
Expand file tree Collapse file tree 1 file changed +10
-21
lines changed Original file line number Diff line number Diff line change @@ -677,30 +677,19 @@ static void io_cqring_do_overflow_flush(struct io_ring_ctx *ctx)
677677 mutex_unlock (& ctx -> uring_lock );
678678}
679679
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-
697680/* must to be called somewhat shortly after putting a request */
698681static inline void io_put_task (struct task_struct * task )
699682{
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+ }
704693}
705694
706695void io_task_refs_refill (struct io_uring_task * tctx )
You can’t perform that action at this time.
0 commit comments