summaryrefslogtreecommitdiff
path: root/sys/kern/vfs_aio.c
diff options
context:
space:
mode:
authorAlan Cox <alc@FreeBSD.org>2005-05-30 19:33:33 +0000
committerAlan Cox <alc@FreeBSD.org>2005-05-30 19:33:33 +0000
commit3999ebe3b6e31dca1f658e2522bab56c0bd7c988 (patch)
treedf27beda152ae3325cc88da3946b24f3ae4b0811 /sys/kern/vfs_aio.c
parentb3d2f94ea7028a8edb1b3d93d6161f8c6258f3b8 (diff)
downloadsrc-test2-3999ebe3b6e31dca1f658e2522bab56c0bd7c988.tar.gz
src-test2-3999ebe3b6e31dca1f658e2522bab56c0bd7c988.zip
Notes
Diffstat (limited to 'sys/kern/vfs_aio.c')
-rw-r--r--sys/kern/vfs_aio.c37
1 files changed, 21 insertions, 16 deletions
diff --git a/sys/kern/vfs_aio.c b/sys/kern/vfs_aio.c
index 5e0d7fcff55b..f11363d33055 100644
--- a/sys/kern/vfs_aio.c
+++ b/sys/kern/vfs_aio.c
@@ -398,24 +398,29 @@ aio_init_aioinfo(struct proc *p)
{
struct kaioinfo *ki;
+ ki = uma_zalloc(kaio_zone, M_WAITOK);
+ ki->kaio_flags = 0;
+ ki->kaio_maxactive_count = max_aio_per_proc;
+ ki->kaio_active_count = 0;
+ ki->kaio_qallowed_count = max_aio_queue_per_proc;
+ ki->kaio_queue_count = 0;
+ ki->kaio_ballowed_count = max_buf_aio;
+ ki->kaio_buffer_count = 0;
+ ki->kaio_buffer_finished_count = 0;
+ ki->kaio_p = p;
+ TAILQ_INIT(&ki->kaio_jobdone);
+ TAILQ_INIT(&ki->kaio_jobqueue);
+ TAILQ_INIT(&ki->kaio_bufdone);
+ TAILQ_INIT(&ki->kaio_bufqueue);
+ TAILQ_INIT(&ki->kaio_liojoblist);
+ TAILQ_INIT(&ki->kaio_sockqueue);
+ PROC_LOCK(p);
if (p->p_aioinfo == NULL) {
- ki = uma_zalloc(kaio_zone, M_WAITOK);
p->p_aioinfo = ki;
- ki->kaio_flags = 0;
- ki->kaio_maxactive_count = max_aio_per_proc;
- ki->kaio_active_count = 0;
- ki->kaio_qallowed_count = max_aio_queue_per_proc;
- ki->kaio_queue_count = 0;
- ki->kaio_ballowed_count = max_buf_aio;
- ki->kaio_buffer_count = 0;
- ki->kaio_buffer_finished_count = 0;
- ki->kaio_p = p;
- TAILQ_INIT(&ki->kaio_jobdone);
- TAILQ_INIT(&ki->kaio_jobqueue);
- TAILQ_INIT(&ki->kaio_bufdone);
- TAILQ_INIT(&ki->kaio_bufqueue);
- TAILQ_INIT(&ki->kaio_liojoblist);
- TAILQ_INIT(&ki->kaio_sockqueue);
+ PROC_UNLOCK(p);
+ } else {
+ PROC_UNLOCK(p);
+ uma_zfree(kaio_zone, ki);
}
while (num_aio_procs < target_aio_procs)