Merge tag 'ptrace-cleanups-for-v5.18' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-2.6-microblaze.git] / fs / io_uring.c
index 59e54a6..b94d57c 100644 (file)
@@ -79,7 +79,6 @@
 #include <linux/task_work.h>
 #include <linux/pagemap.h>
 #include <linux/io_uring.h>
-#include <linux/tracehook.h>
 #include <linux/audit.h>
 #include <linux/security.h>
 
@@ -2750,9 +2749,11 @@ static inline unsigned int io_sqring_entries(struct io_ring_ctx *ctx)
 
 static inline bool io_run_task_work(void)
 {
-       if (test_thread_flag(TIF_NOTIFY_SIGNAL) || current->task_works) {
+       if (test_thread_flag(TIF_NOTIFY_SIGNAL) || task_work_pending(current)) {
                __set_current_state(TASK_RUNNING);
-               tracehook_notify_signal();
+               clear_notify_signal();
+               if (task_work_pending(current))
+                       task_work_run();
                return true;
        }
 
@@ -8041,7 +8042,7 @@ static int io_sq_thread(void *data)
                }
 
                prepare_to_wait(&sqd->wait, &wait, TASK_INTERRUPTIBLE);
-               if (!io_sqd_events_pending(sqd) && !current->task_works) {
+               if (!io_sqd_events_pending(sqd) && !task_work_pending(current)) {
                        bool needs_sched = true;
 
                        list_for_each_entry(ctx, &sqd->ctx_list, sqd_list) {
@@ -11096,7 +11097,7 @@ static __cold void __io_uring_show_fdinfo(struct io_ring_ctx *ctx,
 
                hlist_for_each_entry(req, list, hash_node)
                        seq_printf(m, "  op=%d, task_works=%d\n", req->opcode,
-                                       req->task->task_works != NULL);
+                                       task_work_pending(req->task));
        }
 
        seq_puts(m, "CqOverflowList:\n");