aio: current->io_wait stuff
authorJens Axboe <jens.axboe@oracle.com>
Sat, 26 Sep 2009 15:24:01 +0000 (17:24 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Sat, 26 Sep 2009 15:24:01 +0000 (17:24 +0200)
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
fs/aio.c
include/linux/init_task.h
include/linux/sched.h
kernel/fork.c

index 02a2c9340573cf5946e0083187353d4517319844..0d5e06c1ffaa6377e3a64c561c9e86d498071dbf 100644 (file)
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -695,7 +695,10 @@ static ssize_t aio_run_iocb(struct kiocb *iocb)
         * Now we are all set to call the retry method in async
         * context.
         */
+       BUG_ON(current->io_wait != NULL);
+       current->io_wait = &iocb->ki_wait;
        ret = retry(iocb);
+       current->io_wait = NULL;
 
        if (ret != -EIOCBRETRY && ret != -EIOCBQUEUED) {
                BUG_ON(!list_empty(&iocb->ki_wait.task_list));
index 21a6f5d9af22d92e37f10d7ceab14be22fede177..c72de9cb643f6ccf24a1f01541204ac330e87426 100644 (file)
@@ -177,6 +177,7 @@ extern struct cred init_cred;
                [PIDTYPE_SID]  = INIT_PID_LINK(PIDTYPE_SID),            \
        },                                                              \
        .dirties = INIT_PROP_LOCAL_SINGLE(dirties),                     \
+       .io_wait = NULL,                                                \
        INIT_IDS                                                        \
        INIT_PERF_EVENTS(tsk)                                           \
        INIT_TRACE_IRQFLAGS                                             \
index 75e6e60bf583bb89a7784d4476a32766d10db420..e902d15fc708b498741b0781f70f2862c3af35f5 100644 (file)
@@ -1455,6 +1455,7 @@ struct task_struct {
        struct backing_dev_info *backing_dev_info;
 
        struct io_context *io_context;
+       wait_queue_t *io_wait;
 
        unsigned long ptrace_message;
        siginfo_t *last_siginfo; /* For ptrace use.  */
index 266c6af6ef1b089a1c64ee96428bd153db39217c..2a20e6fbd2d20cb52286fc7663df7d3256c4dca1 100644 (file)
@@ -1075,6 +1075,7 @@ static struct task_struct *copy_process(unsigned long clone_flags,
        p->real_start_time = p->start_time;
        monotonic_to_bootbased(&p->real_start_time);
        p->io_context = NULL;
+       p->io_wait = NULL;
        p->audit_context = NULL;
        cgroup_fork(p);
 #ifdef CONFIG_NUMA