Kprof uses an IRQ alarm
[akaros.git] / kern / drivers / dev / mnt.c
index 09a324e..ac0c426 100644 (file)
@@ -304,7 +304,7 @@ struct chan *mntauth(struct chan *c, char *spec)
 
        c->qid = r->reply.aqid;
        c->mchan = m->c;
-       kref_get(&m->c->ref, 1);
+       chan_incref(m->c);
        c->mqid = c->qid;
        c->mode = ORDWR;
 
@@ -370,7 +370,7 @@ static struct chan *mntattach(char *muxattach)
 
        c->qid = r->reply.qid;
        c->mchan = m->c;
-       kref_get(&m->c->ref, 1);
+       chan_incref(m->c);
        c->mqid = c->qid;
 
        poperror();     /* r */
@@ -465,7 +465,7 @@ static struct walkqid *mntwalk(struct chan *c, struct chan *nc, char **name,
                if (wq->clone != c) {
                        wq->clone->type = c->type;
                        wq->clone->mchan = c->mchan;
-                       kref_get(&c->mchan->ref, 1);
+                       chan_incref(c->mchan);
                }
                if (r->reply.nwqid > 0)
                        wq->clone->qid = r->reply.wqid[r->reply.nwqid - 1];
@@ -808,6 +808,13 @@ void mountio(struct mnt *m, struct mntrpc *r)
        while (waserror()) {
                if (m->rip == current)
                        mntgate(m);
+               if (!strcmp(current_errstr(), "syscall aborted")) {
+                       /* not sure what devmnt wants us to do here.  bail on aborted
+                        * syscall?  keep looping forever? (probably not) */
+                       printk("[kernel] mountio had aborted syscall");
+                       mntflushfree(m, r);
+                       nexterror();
+               }
                if (strcmp(current_errstr(), Eintr) != 0) {
                        mntflushfree(m, r);
                        nexterror();
@@ -1080,6 +1087,7 @@ struct mntrpc *mntralloc(struct chan *c, uint32_t msize)
                        spin_unlock(&mntalloc.l);
                        exhausted("mount rpc header");
                }
+               rendez_init(&new->r);
                /*
                 * The header is split from the data buffer as
                 * mountmux may swap the buffer with another header.