* Init the per-process aioinfo structure. The aioinfo limits are set * per-process for user limit (resource) management. */
| 434 | * per-process for user limit (resource) management. |
| 435 | */ |
| 436 | void |
| 437 | aio_init_aioinfo(struct proc *p) |
| 438 | { |
| 439 | struct kaioinfo *ki; |
| 440 | |
| 441 | ki = uma_zalloc(kaio_zone, M_WAITOK); |
| 442 | mtx_init(&ki->kaio_mtx, "aiomtx", NULL, MTX_DEF | MTX_NEW); |
| 443 | ki->kaio_flags = 0; |
| 444 | ki->kaio_active_count = 0; |
| 445 | ki->kaio_count = 0; |
| 446 | ki->kaio_buffer_count = 0; |
| 447 | TAILQ_INIT(&ki->kaio_all); |
| 448 | TAILQ_INIT(&ki->kaio_done); |
| 449 | TAILQ_INIT(&ki->kaio_jobqueue); |
| 450 | TAILQ_INIT(&ki->kaio_liojoblist); |
| 451 | TAILQ_INIT(&ki->kaio_syncqueue); |
| 452 | TAILQ_INIT(&ki->kaio_syncready); |
| 453 | TASK_INIT(&ki->kaio_task, 0, aio_kick_helper, p); |
| 454 | TASK_INIT(&ki->kaio_sync_task, 0, aio_schedule_fsync, ki); |
| 455 | PROC_LOCK(p); |
| 456 | if (p->p_aioinfo == NULL) { |
| 457 | p->p_aioinfo = ki; |
| 458 | PROC_UNLOCK(p); |
| 459 | } else { |
| 460 | PROC_UNLOCK(p); |
| 461 | mtx_destroy(&ki->kaio_mtx); |
| 462 | uma_zfree(kaio_zone, ki); |
| 463 | } |
| 464 | |
| 465 | while (num_aio_procs < MIN(target_aio_procs, max_aio_procs)) |
| 466 | aio_newproc(NULL); |
| 467 | } |
| 468 | |
| 469 | static int |
| 470 | aio_sendsig(struct proc *p, struct sigevent *sigev, ksiginfo_t *ksi, bool ext) |
no test coverage detected