From b431b6c169c20955a2eb53016a2eefd5ecc36847 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Tue, 8 Nov 2016 00:38:07 +0100 Subject: kernel/qio: fix comments, fix qiwrite() on close queue, remove debug setmalloctag() call in qwrite() --- sys/src/9/port/qio.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'sys/src') diff --git a/sys/src/9/port/qio.c b/sys/src/9/port/qio.c index bcfc573a0..ea2f02dd0 100644 --- a/sys/src/9/port/qio.c +++ b/sys/src/9/port/qio.c @@ -1192,7 +1192,6 @@ qwrite(Queue *q, void *vp, int len) n = Maxatomic; b = allocb(n); - setmalloctag(b, (up->text[0]<<24)|(up->text[1]<<16)|(up->text[2]<<8)|up->text[3]); if(waserror()){ freeb(b); nexterror(); @@ -1201,9 +1200,7 @@ qwrite(Queue *q, void *vp, int len) poperror(); b->wp += n; - qbwrite(q, b); - - sofar += n; + sofar += qbwrite(q, b); } while(sofar < len && (q->state & Qmsg) == 0); return len; @@ -1212,9 +1209,6 @@ qwrite(Queue *q, void *vp, int len) /* * used by print() to write to a queue. Since we may be splhi or not in * a process, don't qlock. - * - * this routine merges adjacent blocks if block n+1 will fit into - * the free space of block n. */ int qiwrite(Queue *q, void *vp, int len) @@ -1242,7 +1236,7 @@ qiwrite(Queue *q, void *vp, int len) /* we use an artificially high limit for kernel prints since anything * over the limit gets dropped */ - if(q->dlen >= 16*1024){ + if((q->state & Qclosed) != 0 || q->len/2 >= q->limit){ iunlock(q); freeb(b); break; @@ -1424,7 +1418,7 @@ qflush(Queue *q) /* free queued blocks */ freeblist(bfirst); - /* wake up readers/writers */ + /* wake up writers */ wakeup(&q->wr); } -- cgit v1.2.3