From 7c75f6ff19f71e1bee32b55b6ca1416f2c3059af Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Wed, 13 Nov 2002 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 2002-11-13 --- port/portfns.h | 1 - port/qio.c | 39 --------------------------------------- 2 files changed, 40 deletions(-) diff --git a/port/portfns.h b/port/portfns.h index e23fee6831d04e62b477ac7d57ebd24a6bb92d98..d82e93cd579d44a867e43192e1ebf99fc488c29d 100644 --- a/port/portfns.h +++ b/port/portfns.h @@ -240,7 +240,6 @@ void putswap(Page*); ulong pwait(Waitmsg*); void qaddlist(Queue*, Block*); Block* qbread(Queue*, int); -long qblen(Queue*); long qbwrite(Queue*, Block*); int qcanread(Queue*); void qclose(Queue*); diff --git a/port/qio.c b/port/qio.c index df35823aa459a58a83afc0acc5097f4975ed18c0..9cc79bd9f5a12b47c1d488f6fdd741b7a627017e 100644 --- a/port/qio.c +++ b/port/qio.c @@ -484,45 +484,6 @@ qdiscard(Queue *q, int len) return sofar; } -/* - * Return length that next qconsume will return - */ -long -qblen(Queue *q) -{ - Block *b; - int n; - Block *tofree = nil; - - ilock(q); - - for(;;) { - b = q->bfirst; - if(b == 0){ - q->state |= Qstarve; - iunlock(q); - return -1; - } - QDEBUG checkb(b, "qblen 1"); - - n = BLEN(b); - if(n > 0) - break; - q->bfirst = b->next; - q->len -= BALLOC(b); - - /* remember to free this */ - b->next = tofree; - tofree = b; - }; - iunlock(q); - - if(tofree != nil) - freeblist(tofree); - - return n; -} - /* * Interrupt level copy out of a queue, return # bytes copied. */