Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/chs-ubc2]: src/sys/kern initialize bufpool in bufinit().



details:   https://anonhg.NetBSD.org/src/rev/6abe43a4d17b
branches:  chs-ubc2
changeset: 471360:6abe43a4d17b
user:      chs <chs%NetBSD.org@localhost>
date:      Sun Jul 04 01:40:43 1999 +0000

description:
initialize bufpool in bufinit().
bring back B_CACHE, it's useful for debugging.

diffstat:

 sys/kern/vfs_bio.c |  17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

diffs (55 lines):

diff -r 144a8e621371 -r 6abe43a4d17b sys/kern/vfs_bio.c
--- a/sys/kern/vfs_bio.c        Sun Jul 04 01:37:45 1999 +0000
+++ b/sys/kern/vfs_bio.c        Sun Jul 04 01:40:43 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vfs_bio.c,v 1.58.6.2 1999/07/02 18:31:28 thorpej Exp $ */
+/*     $NetBSD: vfs_bio.c,v 1.58.6.3 1999/07/04 01:40:43 chs Exp $     */
 
 /*-
  * Copyright (c) 1994 Christopher G. Demetriou
@@ -93,6 +93,8 @@
 TAILQ_HEAD(bqueues, buf) bufqueues[BQUEUES];
 int needbuffer;
 
+struct pool bufpool;
+
 /*
  * Insq/Remq for the buffer free lists.
  */
@@ -132,11 +134,13 @@
 void
 bufinit()
 {
-       register struct buf *bp;
+       struct buf *bp;
        struct bqueues *dp;
-       register int i;
+       int i;
        int base, residual;
 
+       pool_init(&bufpool, sizeof(struct buf), 0, 0, 0, "bufpool", 0,
+                 NULL, NULL, 0);
        for (dp = bufqueues; dp < &bufqueues[BQUEUES]; dp++)
                TAILQ_INIT(dp);
        bufhashtbl = hashinit(nbuf, M_CACHE, M_WAITOK, &bufhash);
@@ -506,6 +510,7 @@
 already_queued:
        /* Unlock the buffer. */
        CLR(bp->b_flags, B_AGE|B_ASYNC|B_BUSY|B_NOCACHE);
+       SET(bp->b_flags, B_CACHE);
 
        /* Allow disk interrupts. */
        splx(s);
@@ -555,6 +560,12 @@
        struct buf *bp;
        int s, err;
 
+#ifdef DIAGNOSTIC
+       if (vp->v_type == VREG && blkno >= 0) {
+               panic("getblk of VREG vp %p blkno 0x%x", vp, blkno);
+       }
+#endif
+
        /*
         * XXX
         * The following is an inlined version of 'incore()', but with



Home | Main Index | Thread Index | Old Index