Lines Matching refs:pipe

77  *  Action: is what file operation is done on the pipe
103 * This code create half duplex pipe buffers for facilitating file like
108 * until the pipe buffer empties enough to continue.
137 #include <sys/pipe.h>
223 static void pipeclose(struct pipe *cpipe);
224 static void pipe_free_kmem(struct pipe *cpipe);
225 static int pipe_create(struct pipe **cpipep);
226 static int pipespace(struct pipe *cpipe, int size);
228 static int expand_pipespace(struct pipe *p, int target_size);
229 static void pipeselwakeup(struct pipe *cpipe, struct pipe *spipe);
230 static __inline int pipeio_lock(struct pipe *cpipe, int catch);
231 static __inline void pipeio_unlock(struct pipe *cpipe);
233 extern int postpipeevent(struct pipe *, int);
234 extern void evpipefree(struct pipe *cpipe);
242 #define MAX_PIPESIZE(pipe) ( MAX(PIPE_SIZE, (pipe)->pipe_buffer.size) )
248 struct pipe *pg_pipe;
259 static void pipe_garbage_collect(struct pipe *cpipe);
270 zone_size = 8192 * sizeof(struct pipe);
271 pipe_zone = zinit(sizeof(struct pipe), zone_size, 4096, "pipe zone");
274 /* allocate lock group attribute and group for pipe mutexes */
276 pipe_mtx_grp = lck_grp_alloc_init("pipe", pipe_mtx_grp_attr);
278 /* allocate the lock attribute for pipe mutexes */
287 zone_size, 4096, "pipe garbage zone");
298 pipe_touch(struct pipe *tpipe, int touch)
347 * expand the size of pipe while there is data to be read,
354 expand_pipespace(struct pipe *p, int target_size)
356 struct pipe tmp, oldpipe;
388 * The pipe system call for the DTYPE_PIPE type of pipes
398 pipe(proc_t p, __unused struct pipe_args *uap, int32_t *retval)
401 struct pipe *rpipe, *wpipe;
458 * struct pipe represents a pipe endpoint. The MAC label is shared
486 pipe_stat(struct pipe *cpipe, void *ub, int isstat64)
550 * address of this pipe's struct pipe. This number may be recycled
577 * address of this pipe's struct pipe. This number may be recycled
597 * Allocate kva for pipe circular buffer, the space is pageable
598 * This routine will 'realloc' the size of a pipe safely, if it fails
603 pipespace(struct pipe *cpipe, int size)
628 * initialize and allocate VM and memory for pipe
631 pipe_create(struct pipe **cpipep)
633 struct pipe *cpipe;
634 cpipe = (struct pipe *)zalloc(pipe_zone);
645 /* Initial times are all the time of creation of the pipe */
652 * lock a pipe for I/O, blocking other access
655 pipeio_lock(struct pipe *cpipe, int catch)
670 * unlock a pipe I/O lock
673 pipeio_unlock(struct pipe *cpipe)
686 pipeselwakeup(struct pipe *cpipe, struct pipe *spipe)
714 struct pipe *rpipe = (struct pipe *)fp->f_data;
735 * normal pipe buffer receive
765 * If there is no more to read in the pipe, reset
798 * Unlock the pipe buffer for our remaining processing.
866 struct pipe *wpipe, *rpipe;
871 rpipe = (struct pipe *)fp->f_data;
877 * detect loss of pipe read side, issue SIGPIPE if lost.
897 * 'pipe ends'... most pipes are half-duplex with the writes targeting
909 * need to do initial allocation or resizing of pipe
973 * and free space in pipe buffer.
983 * pipe buffer. If first segment to transfer
1007 panic("Expected pipe buffer "
1104 /* Update modification, status change (# of bytes in pipe) times */
1120 struct pipe *mpipe = (struct pipe *)fp->f_data;
1177 struct pipe *rpipe = (struct pipe *)fp->f_data;
1178 struct pipe *wpipe;
1181 if (rpipe == NULL || rpipe == (struct pipe *)-1)
1242 struct pipe *cpipe;
1245 cpipe = (struct pipe *)fg->fg_data;
1255 pipe_free_kmem(struct pipe *cpipe)
1268 * shutdown the pipe
1271 pipeclose(struct pipe *cpipe)
1273 struct pipe *ppipe;
1299 * Free the shared pipe label only after the two ends are disconnected.
1358 struct pipe *cpipe;
1360 cpipe = (struct pipe *)kn->kn_fp->f_data;
1385 * other end of pipe has been closed
1408 struct pipe *cpipe = (struct pipe *)kn->kn_fp->f_data;
1430 struct pipe *rpipe = (struct pipe *)kn->kn_fp->f_data;
1431 struct pipe *wpipe;
1436 * world directly and do not currently hold the pipe mutex...
1470 struct pipe *rpipe = (struct pipe *)kn->kn_fp->f_data;
1471 struct pipe *wpipe;
1475 * world directly and do not currently hold the pipe mutex...
1509 fill_pipeinfo(struct pipe * cpipe, struct pipe_info * pinfo)
1597 struct pipe *ppipe, *cpipe = (struct pipe *)(fp->f_fglob->fg_data);
1621 * When a thread sets a write-select on a pipe, it creates an implicit,
1622 * untracked dependency between that thread and the peer of the pipe
1623 * on which the select is set. If the peer pipe is closed and freed
1626 * we notice whenever a dangerous select() is set on a pipe, and
1627 * defer the final deletion of the pipe until that select()s are all
1633 pipe_garbage_collect(struct pipe *cpipe)
1656 /* Add the new pipe (if any) to the tail of the garbage queue */
1663 * pipe. Freeing it runs the risk of panicing the
1669 printf("Leaking pipe %p - no room left in the queue",
1686 panic("Length of pipe garbage queue exceeded %d",