minor lint
[unix-history] / usr / src / sys / kern / vfs_bio.c
index a91fda5..d847c09 100644 (file)
@@ -1,4 +1,4 @@
-/*     vfs_bio.c       3.9     %G%     */
+/*     vfs_bio.c       4.2     %G%     */
 
 #include "../h/param.h"
 #include "../h/systm.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
@@ -339,7 +339,7 @@ daddr_t blkno;
                sleep((caddr_t)&bfreelist, PRIBIO+1);
                goto loop;
        }
                sleep((caddr_t)&bfreelist, PRIBIO+1);
                goto loop;
        }
-       spl0();
+       (void) spl0();
        bp = bfreelist.av_forw;
        notavail(bp);
        if (bp->b_flags & B_DELWRI) {
        bp = bfreelist.av_forw;
        notavail(bp);
        if (bp->b_flags & B_DELWRI) {
@@ -350,6 +350,7 @@ daddr_t blkno;
        if (bp->b_dev == NODEV)
                goto done;
        /* INLINE EXPANSION OF bunhash(bp) */
        if (bp->b_dev == NODEV)
                goto done;
        /* INLINE EXPANSION OF bunhash(bp) */
+       (void) spl6();
        i = BUFHASH(dbtofsb(bp->b_blkno));
        x = bp - buf;
        if (bufhash[i] == x) {
        i = BUFHASH(dbtofsb(bp->b_blkno));
        x = bp - buf;
        if (bufhash[i] == x) {
@@ -364,6 +365,7 @@ daddr_t blkno;
                panic("getblk");
        }
 done:
                panic("getblk");
        }
 done:
+       (void) spl0();
        /* END INLINE EXPANSION */
        bp->b_flags = B_BUSY;
        bp->b_back->b_forw = bp->b_forw;
        /* END INLINE EXPANSION */
        bp->b_flags = B_BUSY;
        bp->b_back->b_forw = bp->b_forw;
@@ -422,23 +424,26 @@ bunhash(bp)
        register struct buf *bp;
 {
        register struct buf *ep;
        register struct buf *bp;
 {
        register struct buf *ep;
-       register int i, x;
+       register int i, x, s;
 
        if (bp->b_dev == NODEV)
                return;
 
        if (bp->b_dev == NODEV)
                return;
+       s = spl6();
        i = BUFHASH(dbtofsb(bp->b_blkno));
        x = bp - buf;
        if (bufhash[i] == x) {
                bufhash[i] = bp->b_hlink;
        i = BUFHASH(dbtofsb(bp->b_blkno));
        x = bp - buf;
        if (bufhash[i] == x) {
                bufhash[i] = bp->b_hlink;
-               return;
+               goto ret;
        }
        for (ep = &buf[bufhash[i]]; ep != &buf[-1];
            ep = &buf[ep->b_hlink])
                if (ep->b_hlink == x) {
                        ep->b_hlink = bp->b_hlink;
        }
        for (ep = &buf[bufhash[i]]; ep != &buf[-1];
            ep = &buf[ep->b_hlink])
                if (ep->b_hlink == x) {
                        ep->b_hlink = bp->b_hlink;
-                       return;
+                       goto ret;
                }
        panic("bunhash");
                }
        panic("bunhash");
+ret:
+       splx(s);
 }
 
 /*
 }
 
 /*
@@ -487,6 +492,8 @@ register struct buf *bp;
 {
        register int s;
 
 {
        register int s;
 
+       if (bp->b_flags & B_DONE)
+               panic("dup iodone");
        bp->b_flags |= B_DONE;
        if (bp->b_flags & B_DIRTY) {
                if (bp->b_flags & B_ERROR)
        bp->b_flags |= B_DONE;
        if (bp->b_flags & B_DIRTY) {
                if (bp->b_flags & B_ERROR)
@@ -585,12 +592,14 @@ swap(p, dblkno, addr, nbytes, rdflg, flag, dev, pfcent)
                bp->b_bcount = c;
                bp->b_blkno = dblkno;
                bp->b_dev = dev;
                bp->b_bcount = c;
                bp->b_blkno = dblkno;
                bp->b_dev = dev;
+               if (flag & B_DIRTY) {
+                       swpf[bp - swbuf] = pfcent;
+                       swsize[bp - swbuf] = nbytes;
+               }
                (*bdevsw[major(dev)].d_strategy)(bp);
                if (flag & B_DIRTY) {
                        if (c < nbytes)
                                panic("big push");
                (*bdevsw[major(dev)].d_strategy)(bp);
                if (flag & B_DIRTY) {
                        if (c < nbytes)
                                panic("big push");
-                       swsize[bp - swbuf] = nbytes;
-                       swpf[bp - swbuf] = pfcent;
                        return;
                }
                (void) spl6();
                        return;
                }
                (void) spl6();