M port/devmnt.c => port/devmnt.c +4 -2
@@ 505,9 505,11 @@ mntread(Chan *c, void *buf, long n, ulong offset)
if(cached) {
nc = cread(c, buf, n, offset);
if(nc > 0) {
+ n -= nc;
+ if(n == 0)
+ return nc;
buf = (uchar*)buf+nc;
offset += nc;
- n -= nc;
}
}
@@ 570,7 572,7 @@ mntrdwr(int type, Chan *c, void *buf, long n, ulong offset)
uba += nr;
cnt += nr;
n -= nr;
- if(nr != r->request.count || n == 0)
+ if(nr != r->request.count || n == 0 || up->nnote)
break;
}
return cnt;
M port/qio.c => port/qio.c +3 -3
@@ 154,9 154,9 @@ iallockproc(void *arg)
* increase goal if we've been drained.
*/
if(cl->have == 0){
- i = cl->goal>>2;
+ i = cl->goal>>1;
if(cl->wanted > i)
- cl->goal += cl->wanted;
+ cl->goal += 2*cl->wanted;
else
cl->goal += i;
cl->wanted = 0;
@@ 195,7 195,7 @@ iallocinit(void)
for(pow = Minpow; pow <= Maxpow; pow++){
cl = &arena.alloc[pow];
- cl->goal = Maxpow-pow + 4;
+ cl->goal = Maxpow-pow + 16;
}
/* start garbage collector */