Lines Matching defs:pipe

32  * "normal" pipe buffering is done.  If the buffer is between PIPE_MINDIRECT
39 * is returned back to the user-mode side. In that case, the pipe code
85 * both directions of a pipe.
114 #include <sys/pipe.h>
139 #define PIPE_PEER(pipe) \
140 (((pipe)->pipe_state & PIPE_NAMED) ? (pipe) : ((pipe)->pipe_peer))
194 * Default pipe buffer size(s), this can be kind-of large now because pipe
195 * space is pageable. The pipe code will try to maintain locality of
222 static void pipeclose(struct pipe *cpipe);
223 static void pipe_free_kmem(struct pipe *cpipe);
224 static void pipe_create(struct pipe *pipe, int backing);
226 static __inline int pipelock(struct pipe *cpipe, int catch);
227 static __inline void pipeunlock(struct pipe *cpipe);
229 static int pipe_build_write_buffer(struct pipe *wpipe, struct uio *uio);
230 static void pipe_destroy_write_buffer(struct pipe *wpipe);
231 static int pipe_direct_write(struct pipe *wpipe, struct uio *uio);
232 static void pipe_clone_write_buffer(struct pipe *wpipe);
234 static int pipespace(struct pipe *cpipe, int size);
235 static int pipespace_new(struct pipe *cpipe, int size);
251 pipe_zone = uma_zcreate("pipe", sizeof(struct pipepair),
256 KASSERT(pipeino_unr != NULL, ("pipe fake inodes not initialized"));
258 KASSERT(pipedev_ino > 0, ("pipe dev inode not initialized"));
265 struct pipe *rpipe, *wpipe;
272 * We zero both pipe endpoints to make sure all the kmem pointers
318 mtx_init(&pp->pp_mtx, "pipe mutex", NULL, MTX_DEF);
338 struct pipe *rpipe, *wpipe;
356 /* Only the forward direction pipe is backed by default */
365 pipe_named_ctor(struct pipe **ppipe, struct thread *td)
375 pipe_dtor(struct pipe *dpipe)
377 struct pipe *peer;
393 * The pipe system call for the DTYPE_PIPE type of pipes. If we fail, let
408 struct pipe *rpipe, *wpipe;
489 * Allocate kva for pipe circular buffer, the space is pageable
490 * This routine will 'realloc' the size of a pipe safely, if it fails
496 struct pipe *cpipe;
504 KASSERT(!mtx_owned(PIPE_MTX(cpipe)), ("pipespace: pipe mutex locked"));
564 struct pipe *cpipe;
569 ("Unlocked pipe passed to pipespace"));
574 * lock a pipe for I/O, blocking other access
578 struct pipe *cpipe;
597 * unlock a pipe I/O lock
601 struct pipe *cpipe;
606 ("Unlocked pipe passed to pipeunlock"));
616 struct pipe *cpipe;
631 * Initialize and allocate VM and memory for pipe. The structure
635 pipe_create(pipe, backing)
636 struct pipe *pipe;
642 * Note that these functions can fail if pipe map is exhausted
646 * with given pipe.
649 (void)pipespace_new(pipe, SMALL_PIPE_SIZE);
651 (void)pipespace_new(pipe, PIPE_SIZE);
654 pipe->pipe_ino = -1;
666 struct pipe *rpipe;
696 * normal pipe buffer receive
720 * If there is no more to read in the pipe, reset
775 * Unlock the pipe buffer for our remaining processing.
839 struct pipe *wpipe;
847 ("Clone attempt on non-direct write pipe!"));
885 struct pipe *wpipe;
900 struct pipe *wpipe;
932 * This implements the pipe buffer write mechanism. Note that only
933 * a direct write OR a normal pipe write can be pending at any given time.
934 * If there are any characters in the pipe buffer, the direct write will
936 * the pipe buffer. Then the direct mapping write is set-up.
940 struct pipe *wpipe;
1050 struct pipe *wpipe, *rpipe;
1061 * detect loss of pipe read side, issue SIGPIPE if lost.
1156 * pipe buffer. We break out if a signal occurs or the
1187 * and free space in pipe buffer.
1196 * pipe buffer. If first segment to transfer
1347 struct pipe *mpipe = fp->f_data;
1422 struct pipe *rpipe;
1423 struct pipe *wpipe;
1498 struct pipe *pipe;
1504 pipe = fp->f_data;
1505 PIPE_LOCK(pipe);
1507 error = mac_pipe_check_stat(active_cred, pipe->pipe_pair);
1509 PIPE_UNLOCK(pipe);
1515 if (pipe->pipe_state & PIPE_NAMED) {
1516 PIPE_UNLOCK(pipe);
1521 * Lazily allocate an inode number for the pipe. Most pipe
1522 * users do not call fstat(2) on the pipe, which means that
1530 if (pipe->pipe_ino == (ino_t)-1) {
1533 pipe->pipe_ino = new_unr;
1535 pipe->pipe_ino = 0;
1537 PIPE_UNLOCK(pipe);
1542 if (pipe->pipe_state & PIPE_DIRECTW)
1543 ub->st_size = pipe->pipe_map.cnt;
1545 ub->st_size = pipe->pipe_buffer.cnt;
1547 ub->st_atim = pipe->pipe_atime;
1548 ub->st_mtim = pipe->pipe_mtime;
1549 ub->st_ctim = pipe->pipe_ctime;
1553 ub->st_ino = pipe->pipe_ino;
1578 struct pipe *cpipe;
1597 struct pipe *cpipe;
1610 struct pipe *cpipe;
1614 ("pipe_free_kmem: pipe mutex locked"));
1633 * shutdown the pipe
1637 struct pipe *cpipe;
1640 struct pipe *ppipe;
1679 * doing that, or the pipe might disappear out from under
1700 * pipe pair. If not, unlock.
1716 struct pipe *cpipe;
1740 /* other end of pipe has been closed */
1760 struct pipe *cpipe = kn->kn_hook;
1771 struct pipe *rpipe = kn->kn_hook;
1772 struct pipe *wpipe = rpipe->pipe_peer;
1794 struct pipe *wpipe;