| plan 9 kernel history: overview | file list | diff list |
1991/1227/port/devpipe.c (diff list | history)
| 1991/1115/sys/src/9/port/devpipe.c:13,19 – 1991/1227/sys/src/9/port/devpipe.c:13,19 (short | long | prev | next) | ||
| 1990/1009 | struct Pipe { Ref; | |
| 1991/1227 | QLock; | |
| 1990/1009 | Pipe *next; }; | |
| 1991/1115/sys/src/9/port/devpipe.c:88,93 – 1991/1227/sys/src/9/port/devpipe.c:88,94 | ||
| 1990/1009 | unlock(&pipealloc); | |
| 1990/11211 | c->qid = (Qid){CHDIR|STREAMQID(2*(p - pipealloc.pipe), 0), 0}; | |
| 1991/1227 | c->dev = 0; | |
| 1990/0227 | return c; } | |
| 1991/1115/sys/src/9/port/devpipe.c:150,170 – 1991/1227/sys/src/9/port/devpipe.c:151,168 | ||
| 1990/1009 | } | |
| 1990/11211 | p = &pipealloc.pipe[STREAMID(c->qid.path)/2]; | |
| 1990/1009 |
| |
| 1991/1227 | qunlock(p); | |
| 1990/1009 | nexterror(); } | |
| 1991/1227 | qlock(p); | |
| 1990/1009 | streamopen(c, &pipeinfo); local = c->stream; if(local->devq->ptr == 0){ /* | |
| 1991/1227 | * first open, create the other end also | |
| 1990/1009 | */ | |
| 1990/11211 |
| |
| 1991/1227 | remote = streamnew(c->type, c->dev, STREAMID(c->qid.path)^1, &pipeinfo,1); | |
| 1990/1009 | /* * connect the device ends of both streams | |
| 1991/1115/sys/src/9/port/devpipe.c:173,187 – 1991/1227/sys/src/9/port/devpipe.c:171,183 | ||
| 1990/1009 | remote->devq->ptr = local; local->devq->other->next = remote->devq; remote->devq->other->next = local->devq; | |
| 1991/1227 | } else if(local->opens == 1){ | |
| 1990/1009 | /* | |
| 1991/1227 | * keep other side around till last close of this side | |
| 1990/1009 | */ | |
| 1990/1118 |
| |
| 1991/1227 | streamenter(local->devq->ptr); | |
| 1990/1009 | } | |
| 1991/1227 | qunlock(p); | |
| 1990/1009 | poperror(); c->mode = omode&~OTRUNC; | |
| 1991/1115/sys/src/9/port/devpipe.c:220,233 – 1991/1227/sys/src/9/port/devpipe.c:216,231 | ||
| 1990/11211 | p = &pipealloc.pipe[STREAMID(c->qid.path)/2]; | |
| 1990/0629 | ||
| 1990/1009 | /* | |
| 1990/1011 |
| |
| 1991/1227 | * take care of local and remote streams | |
| 1990/1009 | */ | |
| 1990/11211 | if(c->stream){ | |
| 1991/1227 | qlock(p); | |
| 1990/11211 | remote = c->stream->devq->ptr; | |
| 1991/0314 |
| |
| 1991/1227 | if(streamclose(c) == 0){ | |
| 1991/0314 | if(remote) streamexit(remote, 0); } | |
| 1991/1227 | qunlock(p); | |
| 1990/11211 | } | |
| 1990/11161 | /* | |
| 1991/1115/sys/src/9/port/devpipe.c:284,291 – 1991/1227/sys/src/9/port/devpipe.c:282,288 | ||
| 1990/0227 | } /* | |
| 1991/1227 | * send the block to the other side | |
| 1990/0227 | */ static void pipeoput(Queue *q, Block *bp) | |
| 1991/1115/sys/src/9/port/devpipe.c:300,306 – 1991/1227/sys/src/9/port/devpipe.c:297,302 | ||
| 1990/0227 | pipestclose(Queue *q) { Block *bp; | |
| 1990/1118 |
| |
| 1990/0227 | /* * point to the bit-bucket and let any in-progress | |