Lines Matching defs: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>
222 static void pipeclose(struct pipe *cpipe);
223 static void pipe_free_kmem(struct pipe *cpipe);
224 static int pipe_create(struct pipe **cpipep);
225 static int pipespace(struct pipe *cpipe, int size);
227 static int expand_pipespace(struct pipe *p, int target_size);
228 static void pipeselwakeup(struct pipe *cpipe, struct pipe *spipe);
229 static __inline int pipeio_lock(struct pipe *cpipe, int catch);
230 static __inline void pipeio_unlock(struct pipe *cpipe);
232 extern int postpipeevent(struct pipe *, int);
233 extern void evpipefree(struct pipe *cpipe);
241 #define MAX_PIPESIZE(pipe) ( MAX(PIPE_SIZE, (pipe)->pipe_buffer.size) )
247 struct pipe *pg_pipe;
258 static void pipe_garbage_collect(struct pipe *cpipe);
269 zone_size = 8192 * sizeof(struct pipe);
270 pipe_zone = zinit(sizeof(struct pipe), zone_size, 4096, "pipe zone");
273 /* allocate lock group attribute and group for pipe mutexes */
275 pipe_mtx_grp = lck_grp_alloc_init("pipe", pipe_mtx_grp_attr);
277 /* allocate the lock attribute for pipe mutexes */
286 zone_size, 4096, "pipe garbage zone");
297 pipe_touch(struct pipe *tpipe, int touch)
346 * expand the size of pipe while there is data to be read,
353 expand_pipespace(struct pipe *p, int target_size)
355 struct pipe tmp, oldpipe;
387 * The pipe system call for the DTYPE_PIPE type of pipes
397 pipe(proc_t p, __unused struct pipe_args *uap, int32_t *retval)
400 struct pipe *rpipe, *wpipe;
459 * struct pipe represents a pipe endpoint. The MAC label is shared
487 pipe_stat(struct pipe *cpipe, void *ub, int isstat64)
551 * address of this pipe's struct pipe. This number may be recycled
578 * address of this pipe's struct pipe. This number may be recycled
598 * Allocate kva for pipe circular buffer, the space is pageable
599 * This routine will 'realloc' the size of a pipe safely, if it fails
604 pipespace(struct pipe *cpipe, int size)
629 * initialize and allocate VM and memory for pipe
632 pipe_create(struct pipe **cpipep)
634 struct pipe *cpipe;
635 cpipe = (struct pipe *)zalloc(pipe_zone);
646 /* Initial times are all the time of creation of the pipe */
653 * lock a pipe for I/O, blocking other access
656 pipeio_lock(struct pipe *cpipe, int catch)
671 * unlock a pipe I/O lock
674 pipeio_unlock(struct pipe *cpipe)
687 pipeselwakeup(struct pipe *cpipe, struct pipe *spipe)
715 struct pipe *rpipe = (struct pipe *)fp->f_data;
736 * normal pipe buffer receive
766 * If there is no more to read in the pipe, reset
799 * Unlock the pipe buffer for our remaining processing.
867 struct pipe *wpipe, *rpipe;
872 rpipe = (struct pipe *)fp->f_data;
878 * detect loss of pipe read side, issue SIGPIPE if lost.
898 * 'pipe ends'... most pipes are half-duplex with the writes targeting
910 * need to do initial allocation or resizing of pipe
974 * and free space in pipe buffer.
984 * pipe buffer. If first segment to transfer
1008 panic("Expected pipe buffer "
1105 /* Update modification, status change (# of bytes in pipe) times */
1121 struct pipe *mpipe = (struct pipe *)fp->f_data;
1178 struct pipe *rpipe = (struct pipe *)fp->f_data;
1179 struct pipe *wpipe;
1182 if (rpipe == NULL || rpipe == (struct pipe *)-1)
1243 struct pipe *cpipe;
1246 cpipe = (struct pipe *)fg->fg_data;
1256 pipe_free_kmem(struct pipe *cpipe)
1269 * shutdown the pipe
1272 pipeclose(struct pipe *cpipe)
1274 struct pipe *ppipe;
1300 * 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",