| plan 9 kernel history: overview | file list | diff list |
1990/1210/port/devmnt.c (diff list | history)
| port/devmnt.c on 1990/0227 | ||
| 1990/0227 | #include "u.h" #include "lib.h" #include "mem.h" #include "dat.h" #include "fns.h" #include "errno.h" #include "devtab.h" #include "fcall.h" typedef struct Mnt Mnt; | |
| 1990/0604 | typedef struct Mnthdr Mnthdr; typedef struct MntQ MntQ; | |
| 1990/0227 | struct Mnt { Ref; /* for number of chans, incl. mntpt but not msg */ | |
| 1990/0303 | ulong mntid; /* serial # */ | |
| 1990/0227 | Chan *mntpt; /* channel in user's name space */ | |
| 1990/0604 | MntQ *q; | |
| 1990/0227 | }; | |
| 1990/0604 | struct MntQ { Ref; QLock; /* for access */ MntQ *next; /* for allocation */ Chan *msg; /* for reading and writing messages */ Proc *reader; /* process reading response */ Mnthdr *writer; /* queue of headers of written messages */ }; | |
| 1990/0227 | #define BUFSIZE (MAXFDATA+500) /* BUG */ typedef struct Mntbuf Mntbuf; struct Mntbuf { Mntbuf *next; char buf[BUFSIZE]; }; struct { Lock; Mntbuf *free; }mntbufalloc; | |
| 1990/0604 | struct Mnthdr | |
| 1990/0227 | { | |
| 1990/1123 | Mnthdr *next; /* in free list or writers list */ Mnthdr *prev; /* in writers list only */ | |
| 1990/1124 | short active; short flushing; /* a Tflush has been sent */ | |
| 1990/0227 | Fcall thdr; Fcall rhdr; | |
| 1990/0604 | Rendez r; Proc *p; Mntbuf *mbr; | |
| 1990/0717 | int readreply; /* true if we are reader or our reply has come */ | |
| 1990/0227 | }; struct { Lock; | |
| 1990/1123 | Mnthdr *arena; | |
| 1990/0227 | Mnthdr *free; }mnthdralloc; | |
| 1990/0303 | struct { Lock; | |
| 1990/0619 | QLock; | |
| 1990/0604 | MntQ *arena; MntQ *free; }mntqalloc; struct { Lock; | |
| 1990/0303 | long id; }mntid; | |
| 1990/0227 | Mnt *mnt; void mntxmit(Mnt*, Mnthdr*); Mntbuf* mballoc(void) { Mntbuf *mb; loop: lock(&mntbufalloc); if(mb = mntbufalloc.free){ /* assign = */ mntbufalloc.free = mb->next; unlock(&mntbufalloc); return mb; } unlock(&mntbufalloc); print("no mntbufs\n"); if(u == 0) panic("mballoc"); u->p->state = Wakeme; alarm(1000, wakeme, u->p); sched(); goto loop; } void mbfree(Mntbuf *mb) { lock(&mntbufalloc); mb->next = mntbufalloc.free; mntbufalloc.free = mb; unlock(&mntbufalloc); } Mnthdr* mhalloc(void) { Mnthdr *mh; loop: lock(&mnthdralloc); if(mh = mnthdralloc.free){ /* assign = */ mnthdralloc.free = mh->next; | |
| 1990/1124 | mh->flushing = 0; | |
| 1990/0227 | unlock(&mnthdralloc); return mh; } unlock(&mnthdralloc); print("no mnthdrs\n"); if(u == 0) | |
| 1990/0604 | panic("mhalloc"); | |
| 1990/0227 | u->p->state = Wakeme; alarm(1000, wakeme, u->p); sched(); goto loop; } void mhfree(Mnthdr *mh) { | |
| 1990/1124 | if(mh->flushing) return; mh->active = 0; | |
| 1990/0227 | lock(&mnthdralloc); mh->next = mnthdralloc.free; mnthdralloc.free = mh; unlock(&mnthdralloc); } | |
| 1990/0604 | MntQ* | |
| 1990/0619 | mqalloc(Chan *msg) /* mntqalloc is qlocked */ | |
| 1990/0604 | { MntQ *q; if(q = mntqalloc.free){ /* assign = */ mntqalloc.free = q->next; lock(q); q->ref = 1; | |
| 1990/0617 | q->msg = msg; unlock(q); incref(msg); | |
| 1990/0604 | q->writer = 0; q->reader = 0; return q; } panic("no mntqs\n"); /* there MUST be enough */ } void mqfree(MntQ *mq) { Chan *msg = 0; lock(mq); if(--mq->ref == 0){ msg = mq->msg; mq->msg = 0; lock(&mntqalloc); mq->next = mntqalloc.free; mntqalloc.free = mq; unlock(&mntqalloc); } unlock(mq); if(msg) /* after locks are down */ close(msg); } | |
| 1990/0227 | Mnt* mntdev(int dev, int noerr) { Mnt *m; | |
| 1990/0303 | int i; | |
| 1990/0227 | ||
| 1990/0303 | for(m=mnt,i=0; i<conf.nmntdev; i++,m++) /* use a hash table some day */ if(m->mntid == dev){ | |
| 1990/0604 | if(m->q == 0) | |
| 1990/0303 | break; return m; } if(noerr) return 0; | |
| 1990/11211 | error(Eshutdown); | |
| 1990/0227 | } void mntreset(void) { int i; Mntbuf *mb; Mnthdr *mh; | |
| 1990/0604 | MntQ *mq; | |
| 1990/0227 | mnt = ialloc(conf.nmntdev*sizeof(Mnt), 0); mb = ialloc(conf.nmntbuf*sizeof(Mntbuf), 0); for(i=0; i<conf.nmntbuf-1; i++) mb[i].next = &mb[i+1]; mb[i].next = 0; mntbufalloc.free = mb; mh = ialloc(conf.nmnthdr*sizeof(Mnthdr), 0); | |
| 1990/11211 | for(i=0; i<conf.nmnthdr-1; i++){ | |
| 1990/0227 | mh[i].next = &mh[i+1]; | |
| 1990/11211 | mh[i].thdr.tag = i; } | |
| 1990/0227 | mh[i].next = 0; | |
| 1990/11211 | mh[i].thdr.tag = i; | |
| 1990/1123 | mnthdralloc.arena = mh; | |
| 1990/0227 | mnthdralloc.free = mh; | |
| 1990/0604 | mq = ialloc(conf.nmntdev*sizeof(MntQ), 0); for(i=0; i<conf.nmntdev-1; i++) mq[i].next = &mq[i+1]; mq[i].next = 0; mntqalloc.arena = mq; mntqalloc.free = mq; | |
| 1990/0227 | } void mntinit(void) { } Chan* | |
| 1990/11211 | mntattach(char *crud) | |
| 1990/0227 | { int i; | |
| 1990/0604 | Mnt *m, *mm; | |
| 1990/0227 | Mnthdr *mh; | |
| 1990/0604 | MntQ *q; | |
| 1990/0227 | Chan *c, *cm; struct bogus{ Chan *chan; char *spec; | |
| 1990/11211 | char *auth; | |
| 1990/0227 | }bogus; | |
| 1990/11211 | bogus = *((struct bogus *)crud); | |
| 1990/0227 | m = mnt; for(i=0; i<conf.nmntdev; i++,m++){ lock(m); if(m->ref == 0) goto Found; unlock(m); } | |
| 1990/11211 | error(Enomntdev); | |
| 1990/0604 | ||
| 1990/0227 | Found: m->ref = 1; unlock(m); | |
| 1990/0303 | lock(&mntid); m->mntid = ++mntid.id; unlock(&mntid); | |
| 1990/11211 | c = devattach('M', bogus.spec); | |
| 1990/0303 | c->dev = m->mntid; | |
| 1990/0227 | m->mntpt = c; cm = bogus.chan; | |
| 1990/0604 | /* * Look for queue to same msg channel */ q = mntqalloc.arena; | |
| 1990/0619 | qlock(&mntqalloc); | |
| 1990/0604 | for(i=0; i<conf.nmntdev; i++,q++) if(q->msg==cm){ lock(q); if(q->ref && q->msg==cm){ m->q = q; q->ref++; unlock(q); goto out; } unlock(q); } | |
| 1990/0617 | m->q = mqalloc(cm); | |
| 1990/0604 | out: | |
| 1990/0619 | qunlock(&mntqalloc); | |
| 1990/0227 | mh = mhalloc(); if(waserror()){ mhfree(mh); close(c); nexterror(); } mh->thdr.type = Tattach; mh->thdr.fid = c->fid; memcpy(mh->thdr.uname, u->p->pgrp->user, NAMELEN); | |
| 1990/11211 | strcpy(mh->thdr.aname, bogus.spec); strcpy(mh->thdr.auth, bogus.auth); | |
| 1990/0227 | mntxmit(m, mh); c->qid = mh->rhdr.qid; | |
| 1990/0604 | c->mchan = m->q->msg; | |
| 1990/0303 | c->mqid = c->qid; | |
| 1990/0227 | mhfree(mh); poperror(); return c; } Chan* mntclone(Chan *c, Chan *nc) { Mnt *m; Mnthdr *mh; int new; new = 0; if(nc == 0){ nc = newchan(); new = 1; if(waserror()){ close(nc); nexterror(); } } m = mntdev(c->dev, 0); mh = mhalloc(); if(waserror()){ mhfree(mh); nexterror(); } mh->thdr.type = Tclone; mh->thdr.fid = c->fid; mh->thdr.newfid = nc->fid; mntxmit(m, mh); nc->type = c->type; nc->dev = c->dev; nc->qid = c->qid; nc->mode = c->mode; nc->flag = c->flag; nc->offset = c->offset; nc->mnt = c->mnt; | |
| 1990/0303 | nc->mchan = c->mchan; nc->mqid = c->qid; | |
| 1990/0227 | mhfree(mh); poperror(); | |
| 1990/0513 | if(new) poperror(); | |
| 1990/0227 | incref(m); return nc; } int mntwalk(Chan *c, char *name) { Mnt *m; Mnthdr *mh; int found; found = 1; m = mntdev(c->dev, 0); mh = mhalloc(); mh->thdr.type = Twalk; mh->thdr.fid = c->fid; strcpy(mh->thdr.name, name); if(waserror()){ /* BUG: can check type of error? */ found = 0; goto Out; } mntxmit(m, mh); c->qid = mh->rhdr.qid; poperror(); Out: mhfree(mh); return found; } void mntstat(Chan *c, char *dp) { Mnt *m; Mnthdr *mh; m = mntdev(c->dev, 0); mh = mhalloc(); if(waserror()){ mhfree(mh); nexterror(); } mh->thdr.type = Tstat; mh->thdr.fid = c->fid; mntxmit(m, mh); memcpy(dp, mh->rhdr.stat, DIRLEN); dp[DIRLEN-4] = devchar[c->type]; dp[DIRLEN-3] = 0; dp[DIRLEN-2] = c->dev; dp[DIRLEN-1] = c->dev>>8; mhfree(mh); poperror(); } Chan* mntopen(Chan *c, int omode) { Mnt *m; Mnthdr *mh; m = mntdev(c->dev, 0); mh = mhalloc(); if(waserror()){ mhfree(mh); nexterror(); } mh->thdr.type = Topen; mh->thdr.fid = c->fid; mh->thdr.mode = omode; mntxmit(m, mh); c->qid = mh->rhdr.qid; mhfree(mh); poperror(); c->offset = 0; c->mode = openmode(omode); c->flag |= COPEN; return c; } void mntcreate(Chan *c, char *name, int omode, ulong perm) { Mnt *m; Mnthdr *mh; m = mntdev(c->dev, 0); mh = mhalloc(); if(waserror()){ mhfree(mh); nexterror(); } mh->thdr.type = Tcreate; mh->thdr.fid = c->fid; strcpy(mh->thdr.name, name); mh->thdr.mode = omode; mh->thdr.perm = perm; mntxmit(m, mh); c->qid = mh->rhdr.qid; mhfree(mh); poperror(); c->flag |= COPEN; c->mode = openmode(omode); c->qid = mh->rhdr.qid; } void | |
| 1990/0604 | mntclunk(Chan *c, int t) | |
| 1990/0227 | { Mnt *m; Mnthdr *mh; | |
| 1990/0604 | MntQ *q; int waserr; | |
| 1990/0227 | m = mntdev(c->dev, 0); mh = mhalloc(); | |
| 1990/0604 | mh->thdr.type = t; | |
| 1990/0227 | mh->thdr.fid = c->fid; | |
| 1990/0604 | waserr = 0; if(waserror()) /* gotta clean up as if there wasn't */ waserr = 1; else mntxmit(m, mh); | |
| 1990/0227 | mhfree(mh); if(c == m->mntpt) m->mntpt = 0; | |
| 1990/0604 | lock(m); if(--m->ref == 0){ /* BUG: need to hang up all pending i/o */ q = m->q; m->q = 0; m->mntid = 0; unlock(m); /* mqfree can take time */ mqfree(q); }else unlock(m); if(waserr) nexterror(); | |
| 1990/0227 | poperror(); } | |
| 1990/0604 | void mntclose(Chan *c) { mntclunk(c, Tclunk); } | |
| 1990/0227 | long mntreadwrite(Chan *c, void *vbuf, long n, int type) { Mnt *m; Mnthdr *mh; long nt, nr, count, offset; char *buf; buf = vbuf; count = 0; offset = c->offset; m = mntdev(c->dev, 0); mh = mhalloc(); if(waserror()){ mhfree(mh); nexterror(); } mh->thdr.type = type; mh->thdr.fid = c->fid; Loop: nt = n; if(nt > MAXFDATA) nt = MAXFDATA; mh->thdr.offset = offset; mh->thdr.count = nt; mh->thdr.data = buf; mntxmit(m, mh); nr = mh->rhdr.count; offset += nr; count += nr; buf += nr; n -= nr; if(n && nr==nt) goto Loop; mhfree(mh); poperror(); return count; } long mntread(Chan *c, void *buf, long n) { long i; uchar *b; n = mntreadwrite(c, buf, n, Tread); | |
| 1990/11211 | if(c->qid.path & CHDIR){ | |
| 1990/0227 | b = (uchar*)buf; for(i=n-DIRLEN; i>=0; i-=DIRLEN){ b[DIRLEN-4] = devchar[c->type]; b[DIRLEN-3] = 0; b[DIRLEN-2] = c->dev; b[DIRLEN-1] = c->dev>>8; b += DIRLEN; } } return n; } long mntwrite(Chan *c, void *buf, long n) { return mntreadwrite(c, buf, n, Twrite); } void mntremove(Chan *c) { | |
| 1990/0604 | mntclunk(c, Tremove); | |
| 1990/0227 | } void mntwstat(Chan *c, char *dp) { Mnt *m; Mnthdr *mh; m = mntdev(c->dev, 0); mh = mhalloc(); if(waserror()){ mhfree(mh); nexterror(); } mh->thdr.type = Twstat; mh->thdr.fid = c->fid; memcpy(mh->thdr.stat, dp, DIRLEN); mntxmit(m, mh); mhfree(mh); poperror(); } void | |
| 1990/1123 | mntwunlink(MntQ *q, Mnthdr *w) /* queue is locked and w is a writer */ | |
| 1990/0604 | { | |
| 1990/1123 | if(w->next) w->next->prev = w->prev; if(w->prev) w->prev->next = w->next; else{ q->writer = w->next; if(q->writer) q->writer->prev = 0; } } | |
| 1990/1124 | /* * m->q is unlocked. Send Tflush message to flush omh->tag. * Cut off all errors. Caller will free omh */ | |
| 1990/1123 | void | |
| 1990/1124 | mntflush(Mnt *m, Mnthdr *omh) /* queue is unlocked */ | |
| 1990/1123 | { | |
| 1990/1124 | Mnthdr *mh; if(omh->thdr.type == Tflush) return; mh = mhalloc(); if(waserror()){ omh->flushing = 0; mhfree(mh); return; /* no more errors please */ } mh->thdr.type = Tflush; mh->thdr.oldtag = omh->thdr.tag; mntxmit(m, mh); omh->flushing = 0; mhfree(mh); poperror(); } void mnterrdequeue(Mnt *m, Mnthdr *mh) /* queue is unlocked */ { | |
| 1990/0604 | Mnthdr *w; | |
| 1990/1124 | MntQ *q; | |
| 1990/0604 | ||
| 1990/1124 | mh->flushing = 1; q = m->q; | |
| 1990/0604 | qlock(q); /* take self from queue if necessary */ if(q->reader == u->p){ /* advance a writer to reader */ w = q->writer; if(w){ | |
| 1990/1124 | mntwunlink(q, w); | |
| 1990/0604 | q->reader = w->p; wakeup(&w->r); }else{ q->reader = 0; q->writer = 0; } | |
| 1990/1123 | }else mntwunlink(q, mh); | |
| 1990/0604 | qunlock(q); | |
| 1990/1124 | mntflush(m, mh); | |
| 1990/0604 | } | |
| 1990/11211 | ||
| 1990/0717 | int mntreadreply(void *a) { return ((Mnthdr *)a)->readreply; } | |
| 1990/11211 | ||
| 1990/0604 | void | |
| 1990/0227 | mntxmit(Mnt *m, Mnthdr *mh) { ulong n; | |
| 1990/1127 | Mntbuf *mbw; | |
| 1990/0604 | Mnthdr *w, *ow; MntQ *q; | |
| 1990/1124 | int qlocked, tag, written; | |
| 1990/0227 | ||
| 1990/1127 | mh->mbr = 0; | |
| 1990/0227 | mbw = mballoc(); | |
| 1990/1124 | if(waserror()){ /* 1 */ | |
| 1990/1127 | if(mh->mbr) mbfree(mh->mbr); | |
| 1990/0227 | mbfree(mbw); nexterror(); } n = convS2M(&mh->thdr, mbw->buf); | |
| 1990/0604 | q = m->q; if(q == 0) | |
| 1990/11211 | error(Eshutdown); | |
| 1990/0604 | #ifdef BIT3 | |
| 1990/03081 | /* | |
| 1990/0511 | * Bit3 does its own multiplexing. (Well, the file server does.) * The code is different enough that it's broken out separately here. | |
| 1990/03081 | */ | |
| 1990/0604 | if(devchar[q->msg->type] != '3') | |
| 1990/0511 | goto Normal; | |
| 1990/0604 | incref(q); | |
| 1990/1124 | if(waserror()){ /* 2 */ | |
| 1990/0604 | mqfree(q); | |
| 1990/0227 | nexterror(); } | |
| 1990/0604 | if((*devtab[q->msg->type].write)(q->msg, mbw->buf, n) != n){ print("short write in mntxmit\n"); | |
| 1990/11211 | error(Eshortmsg); | |
| 1990/0227 | } /* * Read response */ | |
| 1990/1127 | mh->mbr = mballoc(); | |
| 1990/0619 | n = (*devtab[q->msg->type].read)(q->msg, mh->mbr->buf, BUFSIZE); | |
| 1990/0604 | mqfree(q); | |
| 1990/1124 | poperror(); /* 2 */ | |
| 1990/0511 | ||
| 1990/0619 | if(convM2S(mh->mbr->buf, &mh->rhdr, n) == 0){ | |
| 1990/0604 | print("format error in mntxmit\n"); | |
| 1990/11211 | error(Ebadmsg); | |
| 1990/0511 | } /* * Various checks */ | |
| 1990/11211 | if(mh->rhdr.tag != mh->thdr.tag){ print("tag mismatch %d %d\n", mh->rhdr.tag, mh->thdr.tag); error(Ebadmsg); } if(mh->rhdr.type == Rerror){ if(m->mntpt) errors(mh->rhdr.ename); error(Eshutdown); } | |
| 1990/0511 | if(mh->rhdr.type != mh->thdr.type+1){ | |
| 1990/0604 | print("type mismatch %d %d\n", mh->rhdr.type, mh->thdr.type+1); | |
| 1990/11211 | error(Ebadmsg); | |
| 1990/0511 | } if(mh->rhdr.fid != mh->thdr.fid){ | |
| 1990/0604 | print("fid mismatch %d %d type %d\n", mh->rhdr.fid, mh->thdr.fid, mh->rhdr.type); | |
| 1990/11211 | error(Ebadmsg); | |
| 1990/0511 | } /* * Copy out on read */ | |
| 1990/1004 | if(mh->thdr.type == Tread) | |
| 1990/0511 | memcpy(mh->thdr.data, mh->rhdr.data, mh->rhdr.count); | |
| 1990/0619 | mbfree(mh->mbr); | |
| 1990/0511 | mbfree(mbw); | |
| 1990/1124 | poperror(); /* 1 */ | |
| 1990/0511 | return; Normal: | |
| 1990/0604 | #endif incref(q); qlock(q); qlocked = 1; | |
| 1990/1124 | if(waserror()){ /* 2 */ | |
| 1990/0604 | if(qlocked) qunlock(q); mqfree(q); | |
| 1990/0511 | nexterror(); | |
| 1990/03081 | } | |
| 1990/0717 | mh->readreply = 0; | |
| 1990/1124 | mh->active = 1; | |
| 1990/0604 | if((*devtab[q->msg->type].write)(q->msg, mbw->buf, n) != n){ print("short write in mntxmit\n"); | |
| 1990/11211 | error(Eshortmsg); | |
| 1990/0511 | } | |
| 1990/0604 | if(q->reader == 0){ /* i will read */ q->reader = u->p; Read: qunlock(q); qlocked = 0; | |
| 1990/1124 | if(waserror()){ /* 3 */ mnterrdequeue(m, mh); | |
| 1990/0703 | nexterror(); } | |
| 1990/1127 | mh->mbr = mballoc(); | |
| 1990/0619 | n = (*devtab[q->msg->type].read)(q->msg, mh->mbr->buf, BUFSIZE); | |
| 1990/1124 | poperror(); /* 3 */ | |
| 1990/0619 | if(convM2S(mh->mbr->buf, &mh->rhdr, n) == 0){ | |
| 1990/1124 | print("bad reply message\n"); mnterrdequeue(m, mh); | |
| 1990/11211 | error(Ebadmsg); | |
| 1990/0604 | } /* * Response might not be mine */ qlock(q); qlocked = 1; | |
| 1990/1123 | tag = mh->rhdr.tag; if(tag == mh->thdr.tag){ /* it's mine */ | |
| 1990/0604 | q->reader = 0; if(w = q->writer){ /* advance a writer to reader */ | |
| 1990/1124 | mntwunlink(q, w); | |
| 1990/0604 | q->reader = w->p; | |
| 1990/0717 | w->readreply = 1; | |
| 1990/0604 | wakeup(&w->r); } | |
| 1990/1124 | mh->active = 0; | |
| 1990/0604 | qunlock(q); qlocked = 0; goto Respond; } /* * Hand response to correct recipient */ | |
| 1990/1123 | if(tag<0 || tag>=conf.nmnthdr){ print("unknown tag %d\n", tag); goto Read; } w = &mnthdralloc.arena[tag]; | |
| 1990/1124 | if(w->flushing || !w->active) /* nothing to do; mntflush will clean up */ | |
| 1990/1123 | goto Read; | |
| 1990/1127 | w->mbr = mh->mbr; mh->mbr = 0; | |
| 1990/1123 | memcpy(&w->rhdr, &mh->rhdr, sizeof mh->rhdr); mntwunlink(q, w); w->readreply = 1; wakeup(&w->r); | |
| 1990/0604 | goto Read; }else{ mh->p = u->p; /* put self in queue */ mh->next = q->writer; | |
| 1990/1123 | mh->prev = 0; if(q->writer) q->writer->prev = mh; | |
| 1990/0604 | q->writer = mh; qunlock(q); qlocked = 0; if(waserror()){ /* interrupted sleep */ | |
| 1990/1124 | mnterrdequeue(m, mh); | |
| 1990/0604 | nexterror(); } | |
| 1990/0717 | sleep(&mh->r, mntreadreply, mh); | |
| 1990/0604 | poperror(); qlock(q); qlocked = 1; if(q->reader == u->p) /* i got promoted */ goto Read; | |
| 1990/1124 | mh->active = 0; | |
| 1990/0604 | qunlock(q); qlocked = 0; goto Respond; | |
| 1990/0227 | } | |
| 1990/0604 | Respond: mqfree(q); | |
| 1990/1124 | poperror(); /* 2 */ | |
| 1990/11211 | if(mh->rhdr.type == Rerror){ if(m->mntpt) errors(mh->rhdr.ename); error(Eshutdown); | |
| 1990/1124 | }else if(mh->rhdr.type != mh->thdr.type+1){ print("bad type %d not %d in mntxmit\n", mh->rhdr.type, mh->thdr.type+1); error(Ebadmsg); | |
| 1990/0227 | } /* * Copy out on read */ | |
| 1990/0703 | if(mh->thdr.type == Tread){ if(mh->rhdr.count > mh->thdr.count) | |
| 1990/11211 | error(Ebadcnt); | |
| 1990/0227 | memcpy(mh->thdr.data, mh->rhdr.data, mh->rhdr.count); | |
| 1990/0703 | } | |
| 1990/0619 | mbfree(mh->mbr); | |
| 1990/0227 | mbfree(mbw); | |
| 1990/1124 | poperror(); /* 1 */ | |
| 1990/0717 | } mntdump() { int i; MntQ *q; Mnthdr *h; Proc *p; for(i=0; i<conf.nmntdev; i++){ q = &mntqalloc.arena[i]; if(!q->msg) continue; p = q->reader; print("q rdr %d wrtr ", p? p->pid : 0); for(h=q->writer; h; h=h->next) print("(%lux %lux %d)", h, &h->r, (p=h->p)? p->pid : 0); print("\n"); } | |
| 1990/0227 | } | |