From owner-freebsd-current Sun Dec 31 18:18:56 2000 From owner-freebsd-current@FreeBSD.ORG Sun Dec 31 18:18:53 2000 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from pike.osd.bsdi.com (pike.osd.bsdi.com [204.216.28.222]) by hub.freebsd.org (Postfix) with ESMTP id 99ECB37B400 for ; Sun, 31 Dec 2000 18:18:53 -0800 (PST) Received: from foo.osd.bsdi.com (root@foo.osd.bsdi.com [204.216.28.137]) by pike.osd.bsdi.com (8.11.1/8.9.3) with ESMTP id f012IWh40279; Sun, 31 Dec 2000 18:18:32 -0800 (PST) (envelope-from jhb@foo.osd.bsdi.com) Received: (from jhb@localhost) by foo.osd.bsdi.com (8.11.1/8.11.0) id f012Irl22548; Sun, 31 Dec 2000 18:18:53 -0800 (PST) (envelope-from jhb) Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <200101010204.f0124oW47215@earth.backplane.com> Date: Sun, 31 Dec 2000 18:18:52 -0800 (PST) Organization: BSD, Inc. From: John Baldwin To: Matt Dillon Subject: Re: Current hangs... Cc: current@FreeBSD.ORG Sender: jhb@foo.osd.bsdi.com Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On 01-Jan-01 Matt Dillon wrote: >: >:Why not this: >: >:s = splbio(); >:TAILQ_FOREACH(bp, &vp->v_dirtyblkhd, b_vnbufs) { > > First rule when making simple bug fixes by copying working code from one > source file to another is: Dont try to optimize the code on the > fly. That works. > Personally speaking, I don't find the FOREACH macros any more readable > vs an explicit for loop. They hide too much... like for example the > fact that you are dependant on the current pointer remaining valid to > get the next pointer in the loop. Erm, I find one succint line easier to read than something sprawled across 2-3 lines of code. Also, I was never under the assumption that you could do a *_FOREACH() loop while the list changed out from under you. I doubt anyone else is either. :) > -Matt -- John Baldwin -- 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