version 1.10.2.10, 2012/08/02 12:58:02
|
version 1.10.2.11, 2012/08/02 13:45:02
|
Line 647 schedAIOWrite(sched_root_task_t * __restrict root, sch
|
Line 647 schedAIOWrite(sched_root_task_t * __restrict root, sch
|
|
|
#ifdef EVFILT_LIO |
#ifdef EVFILT_LIO |
/* |
/* |
|
* schedLIO() - Add AIO bulk tasks to scheduler queue |
|
* |
|
* @root = root task |
|
* @func = task execution function |
|
* @arg = 1st func argument |
|
* @acbs = AIO cb structure addresses |
|
* @opt_data = Optional data |
|
* @opt_dlen = Optional data length |
|
* return: NULL error or !=NULL new queued task |
|
*/ |
|
sched_task_t * |
|
schedLIO(sched_root_task_t * __restrict root, sched_task_func_t func, void *arg, |
|
struct aiocb ** __restrict acbs, void *opt_data, size_t opt_dlen) |
|
{ |
|
sched_task_t *task; |
|
void *ptr; |
|
|
|
if (!root || !func || !acbs || !opt_dlen) |
|
return NULL; |
|
|
|
/* get new task */ |
|
if (!(task = _sched_useTask(root))) |
|
return NULL; |
|
|
|
task->task_func = func; |
|
TASK_TYPE(task) = taskLIO; |
|
TASK_ROOT(task) = root; |
|
|
|
TASK_ARG(task) = arg; |
|
TASK_VAL(task) = (u_long) acbs; |
|
|
|
TASK_DATA(task) = opt_data; |
|
TASK_DATLEN(task) = opt_dlen; |
|
|
|
if (root->root_hooks.hook_add.lio) |
|
ptr = root->root_hooks.hook_add.lio(task, NULL); |
|
else |
|
ptr = NULL; |
|
|
|
if (!ptr) { |
|
#ifdef HAVE_LIBPTHREAD |
|
pthread_mutex_lock(&root->root_mtx[taskLIO]); |
|
#endif |
|
TAILQ_INSERT_TAIL(&root->root_lio, TASK_ID(task), task_node); |
|
#ifdef HAVE_LIBPTHREAD |
|
pthread_mutex_unlock(&root->root_mtx[taskLIO]); |
|
#endif |
|
} else |
|
task = _sched_unuseTask(task); |
|
|
|
return task; |
|
} |
|
|
|
/* |
* schedLIORead() - Add list of AIO read tasks to scheduler queue |
* schedLIORead() - Add list of AIO read tasks to scheduler queue |
* |
* |
* @root = root task |
* @root = root task |
Line 711 schedLIORead(sched_root_task_t * __restrict root, sche
|
Line 765 schedLIORead(sched_root_task_t * __restrict root, sche
|
return NULL; |
return NULL; |
} |
} |
|
|
return schedAIO(root, func, arg, (void*) acb, bufs, nbufs); | return schedLIO(root, func, arg, (void*) acb, bufs, nbufs); |
} |
} |
|
|
/* |
/* |
Line 779 schedLIOWrite(sched_root_task_t * __restrict root, sch
|
Line 833 schedLIOWrite(sched_root_task_t * __restrict root, sch
|
return NULL; |
return NULL; |
} |
} |
|
|
return schedAIO(root, func, arg, (void*) acb, bufs, nbufs); | return schedLIO(root, func, arg, (void*) acb, bufs, nbufs); |
} |
} |
#endif /* EVFILT_LIO */ |
#endif /* EVFILT_LIO */ |
#endif /* AIO_SUPPORT */ |
#endif /* AIO_SUPPORT */ |