@@ -90,7 +90,7 @@ static bool io_futexv_claim(struct io_futex *iof)
9090 return true;
9191}
9292
93- static bool __io_futex_cancel (struct io_ring_ctx * ctx , struct io_kiocb * req )
93+ static bool __io_futex_cancel (struct io_kiocb * req )
9494{
9595 /* futex wake already done or in progress */
9696 if (req -> opcode == IORING_OP_FUTEX_WAIT ) {
@@ -128,7 +128,7 @@ int io_futex_cancel(struct io_ring_ctx *ctx, struct io_cancel_data *cd,
128128 if (req -> cqe .user_data != cd -> data &&
129129 !(cd -> flags & IORING_ASYNC_CANCEL_ANY ))
130130 continue ;
131- if (__io_futex_cancel (ctx , req ))
131+ if (__io_futex_cancel (req ))
132132 nr ++ ;
133133 if (!(cd -> flags & IORING_ASYNC_CANCEL_ALL ))
134134 break ;
@@ -144,21 +144,7 @@ int io_futex_cancel(struct io_ring_ctx *ctx, struct io_cancel_data *cd,
144144bool io_futex_remove_all (struct io_ring_ctx * ctx , struct io_uring_task * tctx ,
145145 bool cancel_all )
146146{
147- struct hlist_node * tmp ;
148- struct io_kiocb * req ;
149- bool found = false;
150-
151- lockdep_assert_held (& ctx -> uring_lock );
152-
153- hlist_for_each_entry_safe (req , tmp , & ctx -> futex_list , hash_node ) {
154- if (!io_match_task_safe (req , tctx , cancel_all ))
155- continue ;
156- hlist_del_init (& req -> hash_node );
157- __io_futex_cancel (ctx , req );
158- found = true;
159- }
160-
161- return found ;
147+ return io_cancel_remove_all (ctx , tctx , & ctx -> futex_list , cancel_all , __io_futex_cancel );
162148}
163149
164150int io_futex_prep (struct io_kiocb * req , const struct io_uring_sqe * sqe )
0 commit comments