diff options
author | Alan Cox <alc@FreeBSD.org> | 2003-08-13 20:01:38 +0000 |
---|---|---|
committer | Alan Cox <alc@FreeBSD.org> | 2003-08-13 20:01:38 +0000 |
commit | 77685ea594cb328dd213dc9e1985baab4b3c760c (patch) | |
tree | 3d4efd5042f1794fa3227c035c1f73657888737c /sys/kern | |
parent | 4250a68e2d93cafea35ed7e1aeb4e35e73207aba (diff) | |
download | src-77685ea594cb328dd213dc9e1985baab4b3c760c.tar.gz src-77685ea594cb328dd213dc9e1985baab4b3c760c.zip |
- The vm_object pointer in pipe_buffer is unused. Remove it.
- Check for successful initialization of pipe_zone in pipeinit()
rather than every call to pipe(2).
Notes
Notes:
svn path=/head/; revision=118880
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/sys_pipe.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c index 2d0db5b63243..7d39b8c63740 100644 --- a/sys/kern/sys_pipe.c +++ b/sys/kern/sys_pipe.c @@ -213,8 +213,10 @@ SYSINIT(vfs, SI_SUB_VFS, SI_ORDER_ANY, pipeinit, NULL); static void pipeinit(void *dummy __unused) { + pipe_zone = uma_zcreate("PIPE", sizeof(struct pipe), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); + KASSERT(pipe_zone != NULL, ("pipe_zone not initialized")); } /* @@ -234,8 +236,6 @@ pipe(td, uap) struct pipe *rpipe, *wpipe; struct mtx *pmtx; int fd, error; - - KASSERT(pipe_zone != NULL, ("pipe_zone not initialized")); pmtx = malloc(sizeof(*pmtx), M_TEMP, M_WAITOK | M_ZERO); @@ -361,7 +361,6 @@ pipespace(cpipe, size) /* free old resources if we're resizing */ pipe_free_kmem(cpipe); - cpipe->pipe_buffer.object = object; cpipe->pipe_buffer.buffer = buffer; cpipe->pipe_buffer.size = size; cpipe->pipe_buffer.in = 0; @@ -388,8 +387,6 @@ pipe_create(cpipep) cpipe = *cpipep; - /* so pipespace()->pipe_free_kmem() doesn't follow junk pointer */ - cpipe->pipe_buffer.object = NULL; /* * protect so pipeclose() doesn't follow a junk pointer * if pipespace() fails. |