summaryrefslogtreecommitdiff
path: root/sys/src/9
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2016-11-08 00:38:07 +0100
committercinap_lenrek <cinap_lenrek@felloff.net>2016-11-08 00:38:07 +0100
commitb431b6c169c20955a2eb53016a2eefd5ecc36847 (patch)
treee5f8a6a735a694c6961d9a49f0111bb33402f937 /sys/src/9
parent32dfbc7c50873ea4167a7e5352e2fd29f6304d37 (diff)
kernel/qio: fix comments, fix qiwrite() on close queue, remove debug setmalloctag() call in qwrite()
Diffstat (limited to 'sys/src/9')
-rw-r--r--sys/src/9/port/qio.c12
1 files changed, 3 insertions, 9 deletions
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);
}