Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 31 Dec 2000 17:53:40 -0800 (PST)
From:      John Baldwin <jhb@FreeBSD.ORG>
To:        Matt Dillon <dillon@earth.backplane.com>
Cc:        current@FreeBSD.ORG
Subject:   Re: Current hangs...
Message-ID:  <XFMail.001231175340.jhb@FreeBSD.org>
In-Reply-To: <200012302342.eBUNgW142476@earth.backplane.com>

next in thread | previous in thread | raw e-mail | index | archive | help

On 30-Dec-00 Matt Dillon wrote:
>  #include <sys/param.h>
> @@ -352,12 +352,25 @@
>               return (0);
>  
>       /*
> +      * MARK/SCAN initialization to avoid infinite loops
> +      */
> +     s = splbio();
> +        for (bp = TAILQ_FIRST(&vp->v_dirtyblkhd); bp;
> +             bp = TAILQ_NEXT(bp, b_vnbufs)) {
> +                bp->b_flags &= ~B_SCANNED;
> +     }
> +     splx(s);

Why not this:

s = splbio();
TAILQ_FOREACH(bp, &vp->v_dirtyblkhd, b_vnbufs) {
        bp->b_flags &= ~B_SCANNED;
}

We do have foreach queue(3) macros. :)

-- 

John Baldwin <jhb@FreeBSD.org> -- http://www.FreeBSD.org/~jhb/
PGP Key: http://www.Baldwin.cx/~john/pgpkey.asc
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.001231175340.jhb>