-/*
- * The following several routines allocate and free
- * buffers with various side effects. In general the
- * arguments to an allocate routine are a device and
- * a block number, and the value is a pointer to
- * to the buffer header; the buffer is marked "busy"
- * so that no one else can touch it. If the block was
- * already in core, no I/O need be done; if it is
- * already busy, the process waits until it becomes free.
- * The following routines allocate a buffer:
- * getblk
- * bread
- * breada
- * baddr (if it is incore)
- * Eventually the buffer must be released, possibly with the
- * side effect of writing it out, by using one of
- * bwrite
- * bdwrite
- * bawrite
- * brelse
- */
-
-struct buf bfreelist[BQUEUES];
-struct buf bswlist, *bclnlist;
-
-#define BUFHSZ 63
-#define RND (MAXBSIZE/DEV_BSIZE)
-struct bufhd bufhash[BUFHSZ];
-#define BUFHASH(dev, dblkno) \
- ((struct buf *)&bufhash[((int)(dev)+(((int)(dblkno))/RND)) % BUFHSZ])
-
-/*
- * Initialize hash links for buffers.
- */
-bhinit()
-{
- register int i;
- register struct bufhd *bp;
-
- for (bp = bufhash, i = 0; i < BUFHSZ; i++, bp++)
- bp->b_forw = bp->b_back = (struct buf *)bp;
-}
-
-/* #define DISKMON 1 */
-
-#ifdef DISKMON
-struct {
- int nbuf;
- long nread;
- long nreada;
- long ncache;
- long nwrite;
- long bufcount[64];
-} io_info;
-#endif
-
-/*
-
-#ifndef UNFAST
-#define notavail(bp) \
-{ \
- int x = spl6(); \
- (bp)->av_back->av_forw = (bp)->av_forw; \
- (bp)->av_forw->av_back = (bp)->av_back; \
- (bp)->b_flags |= B_BUSY; \
- splx(x); \
-}
-#endif