@@ -711,10 +711,8 @@ static ssize_t aio_run_iocb(struct kiocb *iocb)
711711 */
712712 ret = retry (iocb );
713713
714- if (ret != - EIOCBRETRY && ret != - EIOCBQUEUED ) {
715- BUG_ON (!list_empty (& iocb -> ki_wait .task_list ));
714+ if (ret != - EIOCBRETRY && ret != - EIOCBQUEUED )
716715 aio_complete (iocb , ret , 0 );
717- }
718716out :
719717 spin_lock_irq (& ctx -> ctx_lock );
720718
@@ -866,13 +864,6 @@ static void try_queue_kicked_iocb(struct kiocb *iocb)
866864 unsigned long flags ;
867865 int run = 0 ;
868866
869- /* We're supposed to be the only path putting the iocb back on the run
870- * list. If we find that the iocb is *back* on a wait queue already
871- * than retry has happened before we could queue the iocb. This also
872- * means that the retry could have completed and freed our iocb, no
873- * good. */
874- BUG_ON ((!list_empty (& iocb -> ki_wait .task_list )));
875-
876867 spin_lock_irqsave (& ctx -> ctx_lock , flags );
877868 /* set this inside the lock so that we can't race with aio_run_iocb()
878869 * testing it and putting the iocb on the run list under the lock */
@@ -886,7 +877,7 @@ static void try_queue_kicked_iocb(struct kiocb *iocb)
886877/*
887878 * kick_iocb:
888879 * Called typically from a wait queue callback context
889- * (aio_wake_function) to trigger a retry of the iocb.
880+ * to trigger a retry of the iocb.
890881 * The retry is usually executed by aio workqueue
891882 * threads (See aio_kick_handler).
892883 */
@@ -1520,31 +1511,6 @@ static ssize_t aio_setup_iocb(struct kiocb *kiocb)
15201511 return 0 ;
15211512}
15221513
1523- /*
1524- * aio_wake_function:
1525- * wait queue callback function for aio notification,
1526- * Simply triggers a retry of the operation via kick_iocb.
1527- *
1528- * This callback is specified in the wait queue entry in
1529- * a kiocb.
1530- *
1531- * Note:
1532- * This routine is executed with the wait queue lock held.
1533- * Since kick_iocb acquires iocb->ctx->ctx_lock, it nests
1534- * the ioctx lock inside the wait queue lock. This is safe
1535- * because this callback isn't used for wait queues which
1536- * are nested inside ioctx lock (i.e. ctx->wait)
1537- */
1538- static int aio_wake_function (wait_queue_t * wait , unsigned mode ,
1539- int sync , void * key )
1540- {
1541- struct kiocb * iocb = container_of (wait , struct kiocb , ki_wait );
1542-
1543- list_del_init (& wait -> task_list );
1544- kick_iocb (iocb );
1545- return 1 ;
1546- }
1547-
15481514static void aio_batch_add (struct address_space * mapping ,
15491515 struct hlist_head * batch_hash )
15501516{
@@ -1642,8 +1608,6 @@ static int io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb,
16421608 req -> ki_buf = (char __user * )(unsigned long )iocb -> aio_buf ;
16431609 req -> ki_left = req -> ki_nbytes = iocb -> aio_nbytes ;
16441610 req -> ki_opcode = iocb -> aio_lio_opcode ;
1645- init_waitqueue_func_entry (& req -> ki_wait , aio_wake_function );
1646- INIT_LIST_HEAD (& req -> ki_wait .task_list );
16471611
16481612 ret = aio_setup_iocb (req );
16491613
0 commit comments