diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2001-06-23 06:04:35 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2001-06-23 06:04:35 +0000 |
commit | 80a26340320fe6e1c39351bacdebeb5e704cdc4e (patch) | |
tree | cb06fe9361aa5f0ad14f6feb1b921abc734f180c /sys/kern | |
parent | a74e8403c89e62f9eb01ff5804d2389e799fc15f (diff) |
Add pipe_init, call it from main, move the pool initialization into it.
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/init_main.c | 8 | ||||
-rw-r--r-- | sys/kern/sys_pipe.c | 16 |
2 files changed, 17 insertions, 7 deletions
diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index f30307b5a1d..3635e8b94fb 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: init_main.c,v 1.66 2001/06/22 14:14:08 deraadt Exp $ */ +/* $OpenBSD: init_main.c,v 1.67 2001/06/23 06:04:34 art Exp $ */ /* $NetBSD: init_main.c,v 1.84.4.1 1996/06/02 09:08:06 mrg Exp $ */ /* @@ -78,6 +78,7 @@ #endif #include <sys/domain.h> #include <sys/mbuf.h> +#include <sys/pipe.h> #include <sys/syscall.h> #include <sys/syscallargs.h> @@ -245,6 +246,11 @@ main(framep) filedesc_init(); /* + * Initialize pipes. + */ + pipe_init(); + + /* * Create process 0 (the swapper). */ LIST_INSERT_HEAD(&allproc, p, p_list); diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c index f60b7ec9f69..85f38a06d4b 100644 --- a/sys/kern/sys_pipe.c +++ b/sys/kern/sys_pipe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sys_pipe.c,v 1.32 2001/06/05 18:28:18 provos Exp $ */ +/* $OpenBSD: sys_pipe.c,v 1.33 2001/06/23 06:04:34 art Exp $ */ /* * Copyright (c) 1996 John S. Dyson @@ -127,11 +127,6 @@ sys_opipe(p, v, retval) struct pipe *rpipe, *wpipe; int fd, error; - if (pipe_pool == NULL) - pipe_pool = pool_create(sizeof(struct pipe), 0, 0, 0, "pipepl", - 0, pool_page_alloc_nointr, pool_page_free_nointr, - M_PIPE); - rpipe = pool_get(pipe_pool, PR_WAITOK); pipeinit(rpipe); wpipe = pool_get(pipe_pool, PR_WAITOK); @@ -888,3 +883,12 @@ filt_pipewrite(struct knote *kn, long hint) return (kn->kn_data >= PIPE_BUF); } + +void +pipe_init() +{ + pipe_pool = pool_create(sizeof(struct pipe), 0, 0, 0, "pipepl", + 0, pool_page_alloc_nointr, pool_page_free_nointr, + M_PIPE); +} + |