diff options
| author | Alan Cox <alc@FreeBSD.org> | 2003-09-06 21:02:10 +0000 |
|---|---|---|
| committer | Alan Cox <alc@FreeBSD.org> | 2003-09-06 21:02:10 +0000 |
| commit | 603d3d4a44efc8924906a56e61520e1d47d0ec24 (patch) | |
| tree | e1b0f743929614728e967cd4381dc9b1afb37836 | |
| parent | 51a257c0e5e01ee74080f5d5534b86c36bd594be (diff) | |
Notes
| -rw-r--r-- | sys/kern/sys_pipe.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c index e003d5e9d685..50ea163858c4 100644 --- a/sys/kern/sys_pipe.c +++ b/sys/kern/sys_pipe.c @@ -743,9 +743,7 @@ pipe_destroy_write_buffer(wpipe) { int i; - GIANT_REQUIRED; PIPE_LOCK_ASSERT(wpipe, MA_NOTOWNED); - if (wpipe->pipe_map.kva) { pmap_qremove(wpipe->pipe_map.kva, wpipe->pipe_map.npages); @@ -754,7 +752,7 @@ pipe_destroy_write_buffer(wpipe) vm_offset_t kva = wpipe->pipe_map.kva; wpipe->pipe_map.kva = 0; kmem_free(kernel_map, kva, - wpipe->pipe_buffer.size + PAGE_SIZE); + wpipe->pipe_buffer.size + PAGE_SIZE); atomic_subtract_int(&amountpipekvawired, wpipe->pipe_buffer.size + PAGE_SIZE); } @@ -788,11 +786,11 @@ pipe_clone_write_buffer(wpipe) wpipe->pipe_buffer.cnt = size; wpipe->pipe_state &= ~PIPE_DIRECTW; - PIPE_GET_GIANT(wpipe); + PIPE_UNLOCK(wpipe); bcopy((caddr_t) wpipe->pipe_map.kva + pos, wpipe->pipe_buffer.buffer, size); pipe_destroy_write_buffer(wpipe); - PIPE_DROP_GIANT(wpipe); + PIPE_LOCK(wpipe); } /* @@ -861,9 +859,9 @@ retry: while (!error && (wpipe->pipe_state & PIPE_DIRECTW)) { if (wpipe->pipe_state & PIPE_EOF) { pipelock(wpipe, 0); - PIPE_GET_GIANT(wpipe); + PIPE_UNLOCK(wpipe); pipe_destroy_write_buffer(wpipe); - PIPE_DROP_GIANT(wpipe); + PIPE_LOCK(wpipe); pipeselwakeup(wpipe); pipeunlock(wpipe); error = EPIPE; @@ -886,9 +884,9 @@ retry: */ pipe_clone_write_buffer(wpipe); } else { - PIPE_GET_GIANT(wpipe); + PIPE_UNLOCK(wpipe); pipe_destroy_write_buffer(wpipe); - PIPE_DROP_GIANT(wpipe); + PIPE_LOCK(wpipe); } pipeunlock(wpipe); return (error); |
