/* Called by the exiting task */ void exit_io_context(struct task_struct *task) { struct io_context *ioc; task_lock(task); ioc = task->io_context; task->io_context = NULL; task_unlock(task); if (atomic_dec_and_test(&ioc->nr_tasks)) hlist_sched_exit(ioc, &ioc->cic_list); hlist_sched_exit(ioc, &ioc->bfq_cic_list); put_io_context(ioc); }
/* Called by the exitting task */ void exit_io_context(void) { struct io_context *ioc; task_lock(current); ioc = current->io_context; current->io_context = NULL; task_unlock(current); if (atomic_dec_and_test(&ioc->nr_tasks)) { if (ioc->aic && ioc->aic->exit) ioc->aic->exit(ioc->aic); // cfq_exit(ioc); hlist_sched_exit(ioc, &ioc->cic_list); hlist_sched_exit(ioc, &ioc->bfq_cic_list); put_io_context(ioc); } }