| plan 9 kernel history: overview | file list | diff list |
1990/11211/port/chan.c (diff list | history)
| 1990/1104/sys/src/9/port/chan.c:80,90 – 1990/11211/sys/src/9/port/chan.c:80,91 (short | long | prev | next) | ||
| 1990/0227 | c->flag = 0; c->ref = 1; unlock(&chanalloc); | |
| 1990/11211 | c->dev = 0; | |
| 1990/0227 | c->offset = 0; c->mnt = 0; c->stream = 0; | |
| 1990/0303 | c->mchan = 0; | |
| 1990/11211 | c->mqid = (Qid){0, 0}; | |
| 1990/0227 | return c; } unlock(&chanalloc); | |
| 1990/1104/sys/src/9/port/chan.c:116,125 – 1990/11211/sys/src/9/port/chan.c:117,134 | ||
| 1990/0227 | } int | |
| 1990/11211 | eqqid(Qid a, Qid b) | |
| 1990/0227 | { | |
| 1990/11211 | return a.path==b.path && a.vers==b.vers; } int eqchan(Chan *a, Chan *b, int pathonly) { if(a->qid.path != b->qid.path) | |
| 1990/0227 | return 0; | |
| 1990/11211 | if(!pathonly && a->qid.vers!=b->qid.vers) return 0; | |
| 1990/0227 | if(a->type != b->type) return 0; if(a->dev != b->dev) | |
| 1990/1104/sys/src/9/port/chan.c:158,167 – 1990/11211/sys/src/9/port/chan.c:167,176 | ||
| 1990/0227 | Pgrp *pg; | |
| 1990/0321 | int islast; | |
| 1990/0227 |
| |
| 1990/11211 | if(CHDIR & (old->qid.path^new->qid.path)) error(Emount); if((old->qid.path&CHDIR)==0 && (flag&MORDER)!=MREPL) error(Emount); | |
| 1990/0227 | mz = 0; | |
| 1990/0321 | islast = 0; | |
| 1990/1104/sys/src/9/port/chan.c:190,196 – 1990/11211/sys/src/9/port/chan.c:199,205 | ||
| 1990/0227 | } if(mz == 0){ if(i == conf.nmtab) | |
| 1990/11211 | error(Enomount); | |
| 1990/0227 | mz = &pg->mtab[i]; | |
| 1990/0321 | islast++; | |
| 1990/0227 | } | |
| 1990/1104/sys/src/9/port/chan.c:210,216 – 1990/11211/sys/src/9/port/chan.c:219,225 | ||
| 1990/0227 | */ case MBEFORE: if(mt->mnt == 0) | |
| 1990/11211 | error(Enotunion); | |
| 1990/0227 | /* fall through */ case MREPL: | |
| 1990/1104/sys/src/9/port/chan.c:227,233 – 1990/11211/sys/src/9/port/chan.c:236,242 | ||
| 1990/0227 | */ case MAFTER: if(mt->mnt == 0) | |
| 1990/11211 | error(Enotunion); | |
| 1990/0227 | omnt = mt->mnt; pmnt = 0; while(!omnt->term){ | |
| 1990/1104/sys/src/9/port/chan.c:416,426 – 1990/11211/sys/src/9/port/chan.c:425,435 | ||
| 1990/0227 | mnt = c->mnt; if(c->mountid != mnt->mountid){ | |
| 1990/0321 | pprint("createdir: changed underfoot?\n"); | |
| 1990/0227 |
| |
| 1990/11211 | error(Enocreate); | |
| 1990/0227 | } do{ if(mnt->term) | |
| 1990/11211 | error(Enocreate); | |
| 1990/0227 | mnt = mnt->next; }while(!(mnt->c->flag&CCREATE)); mc = mnt->c; | |
| 1990/1104/sys/src/9/port/chan.c:457,463 – 1990/11211/sys/src/9/port/chan.c:466,472 | ||
| 1990/0821 | char *elem; | |
| 1990/0227 | if(name[0] == 0) | |
| 1990/11211 | error(Enonexist); | |
| 1990/0821 | /* * Make sure all of name is o.k. first byte is validated | |
| 1990/1104/sys/src/9/port/chan.c:484,493 – 1990/11211/sys/src/9/port/chan.c:493,502 | ||
| 1990/0227 | }else if(name[0] == '#'){ mntok = 0; | |
| 1990/1009 | if(name[1]=='M') | |
| 1990/0227 |
| |
| 1990/11211 | error(Enonexist); | |
| 1990/0227 | t = devno(name[1], 1); if(t == -1) | |
| 1990/11211 | error(Ebadsharp); | |
| 1990/0227 | name += 2; if(*name == '/'){ name = skipslash(name); | |
| 1990/1104/sys/src/9/port/chan.c:519,525 – 1990/11211/sys/src/9/port/chan.c:528,534 | ||
| 1990/0227 | */ while(*name){ if((nc=walk(c, elem, mntok)) == 0) | |
| 1990/11211 | error(Enonexist); | |
| 1990/0227 | c = nc; name = nextelem(name, elem); } | |
| 1990/1104/sys/src/9/port/chan.c:534,540 – 1990/11211/sys/src/9/port/chan.c:543,549 | ||
| 1990/0820 | c = domount(c); else{ if((nc=walk(c, elem, mntok)) == 0) | |
| 1990/11211 | error(Enonexist); | |
| 1990/0820 | c = nc; } | |
| 1990/0227 | break; | |
| 1990/1104/sys/src/9/port/chan.c:545,554 – 1990/11211/sys/src/9/port/chan.c:554,563 | ||
| 1990/0227 | * so one may mount on / or . and see the effect. */ if((nc=walk(c, elem, 0)) == 0) | |
| 1990/11211 | error(Enonexist); | |
| 1990/0227 | c = nc; | |
| 1990/11211 | if(!(c->qid.path & CHDIR)) error(Enotdir); | |
| 1990/0227 | break; case Aopen: | |
| 1990/1104/sys/src/9/port/chan.c:556,562 – 1990/11211/sys/src/9/port/chan.c:565,571 | ||
| 1990/0820 | c = domount(c); else{ if((nc=walk(c, elem, mntok)) == 0) | |
| 1990/11211 | error(Enonexist); | |
| 1990/0820 | c = nc; } | |
| 1990/0227 | Open: | |
| 1990/1104/sys/src/9/port/chan.c:573,585 – 1990/11211/sys/src/9/port/chan.c:582,594 | ||
| 1990/0227 | * the replacement. */ if((nc=walk(c, elem, 0)) == 0) | |
| 1990/11211 | error(Enonexist); | |
| 1990/0227 | c = nc; break; case Acreate: | |
| 1990/0820 | if(isdot) | |
| 1990/11211 | error(Eisdir); | |
| 1990/0227 | if((nc=walk(c, elem, 1)) != 0){ c = nc; omode |= OTRUNC; | |
| 1990/1104/sys/src/9/port/chan.c:637,648 – 1990/11211/sys/src/9/port/chan.c:646,657 | ||
| 1990/0227 | char *end, *e; if(*name == '/') | |
| 1990/11211 | error(Efilename); | |
| 1990/0821 | end = memchr(name, 0, NAMELEN); | |
| 1990/0227 | if(end == 0){ | |
| 1990/0821 | end = memchr(name, '/', NAMELEN); | |
| 1990/0227 | if(end == 0) | |
| 1990/11211 | error(Efilename); | |
| 1990/0227 | }else{ e = memchr(name, '/', end-name); if(e) | |
| 1990/1104/sys/src/9/port/chan.c:651,657 – 1990/11211/sys/src/9/port/chan.c:660,666 | ||
| 1990/0227 | while(name < end){ c = *name++; if((c&0x80) || isfrog[c]) | |
| 1990/11211 | error(Ebadchar); | |
| 1990/0227 | *elem++ = c; } *elem = 0; | |
| 1990/1104/sys/src/9/port/chan.c:661,667 – 1990/11211/sys/src/9/port/chan.c:670,676 | ||
| 1990/0227 | void isdir(Chan *c) { | |
| 1990/11211 | if(c->qid.path & CHDIR) | |
| 1990/0227 | return; | |
| 1990/11211 | error(Enotdir); | |
| 1990/0227 | } | |