Source-Changes-HG archive

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

[src/trunk]: src/sbin/fsck_lfs PR/51440: Jose Luis Rodriguez Garcia: Use the ...



details:   https://anonhg.NetBSD.org/src/rev/1dc2d88f6910
branches:  trunk
changeset: 347410:1dc2d88f6910
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Aug 25 07:43:18 2016 +0000

description:
PR/51440: Jose Luis Rodriguez Garcia: Use the standard queue.h macro instead
of playing with the TAILQ's entrails.

diffstat:

 sbin/fsck_lfs/bufcache.c |  6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diffs (27 lines):

diff -r a8f2e9ed8bd4 -r 1dc2d88f6910 sbin/fsck_lfs/bufcache.c
--- a/sbin/fsck_lfs/bufcache.c  Thu Aug 25 07:39:55 2016 +0000
+++ b/sbin/fsck_lfs/bufcache.c  Thu Aug 25 07:43:18 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bufcache.c,v 1.18 2016/08/18 08:08:02 christos Exp $ */
+/* $NetBSD: bufcache.c,v 1.19 2016/08/25 07:43:18 christos Exp $ */
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -173,8 +173,6 @@
         * We only calculate the head of the freelist when removing
         * the last element of the list as that is the only time that
         * it is needed (e.g. to reset the tail pointer).
-        *
-        * NB: This makes an assumption about how tailq's are implemented.
         */
        if (bp->b_flags & B_LOCKED) {
                locked_queue_bytes -= bp->b_bcount;
@@ -182,7 +180,7 @@
        }
        if (TAILQ_NEXT(bp, b_freelist) == NULL) {
                for (dp = bufqueues; dp < &bufqueues[BQUEUES]; dp++)
-                       if (dp->tqh_last == &bp->b_freelist.tqe_next)
+                       if (TAILQ_LAST(dp, bqueues) == bp)
                                break;
                if (dp == &bufqueues[BQUEUES])
                        errx(1, "bremfree: lost tail");



Home | Main Index | Thread Index | Old Index