[AIO] cleanup thread based aio fallback code Clean up the thread based aio fallback code by making use of ki_opcode to switch based on the iocb. Introduce a cancel method for thread based fallback that sends a SIGKILL to the thread performing the io. Signed-off-by: Benjamin LaHaise diff -purN --exclude=description 88_thread_cleanup/fs/aio.c 89_debug_cleanup/fs/aio.c --- 88_thread_cleanup/fs/aio.c 2005-08-17 13:54:36.000000000 -0400 +++ 89_debug_cleanup/fs/aio.c 2005-08-17 12:40:36.000000000 -0400 @@ -139,7 +139,7 @@ static int aio_setup_ring(struct kioctx 0); if (IS_ERR((void *)info->mmap_base)) { up_write(&ctx->mm->mmap_sem); - printk("mmap err: %ld\n", -info->mmap_base); + dprintk("mmap err: %ld\n", -info->mmap_base); info->mmap_size = 0; aio_free_ring(ctx); return -EAGAIN; @@ -495,6 +495,7 @@ static int __aio_put_req(struct kioctx * BUG(); if (likely(req->ki_users)) return 0; + BUG_ON(!list_empty(&req->ki_wait.wait.task_list)); list_del(&req->ki_list); /* remove from active_reqs */ req->ki_cancel = NULL; req->ki_retry = NULL; @@ -670,7 +671,7 @@ static ssize_t aio_run_iocb(struct kiocb ssize_t ret; if (iocb->ki_retried++ > 1024*1024) { - printk("Maximal retry count. Bytes done %Zd\n", + printk(KERN_DEBUG "Maximal retry count. Bytes done %Zd\n", iocb->ki_nbytes - iocb->ki_left); return -EAGAIN; } @@ -681,7 +682,7 @@ static ssize_t aio_run_iocb(struct kiocb } if (!(retry = iocb->ki_retry)) { - printk("aio_run_iocb: iocb->ki_retry = NULL\n"); + printk(KERN_DEBUG "aio_run_iocb: iocb->ki_retry = NULL\n"); return 0; } @@ -1992,6 +1993,9 @@ asmlinkage long sys_io_submit(aio_contex /* * AKPM: should this return a partial result if some of the IOs were * successfully submitted? + * bcrl: yes. By returning either the partial result or an error, + * applications can resubmit the requests that were not completed + * to discover the error code returned by the submit path. */ for (i=0; i