Re: TAILQ_* ambiguity in sys/sys/bio.h

From: Luigi Rizzo (rizzo_at_icir.org)
Date: 07/20/05

  • Next message: Marcin Jessa: "Re: FreeBSD6, FSC Lifebook E8010, Xorg"
    Date: Wed, 20 Jul 2005 09:23:36 -0700
    To: Poul-Henning Kamp <phk@haven.freebsd.dk>
    
    

    On Wed, Jul 20, 2005 at 05:49:57PM +0200, Poul-Henning Kamp wrote:
    > In message <20050720083942.A35046@xorpc.icir.org>, Luigi Rizzo writes:
    > >forgive me if i am wrong, but there appears to be a source of
    > >ambiguity in the use of TAILQ* macros in sys/sys/bio.h
    >
    > Make sure to do a make universe before sending me the patch
    > for review.

    yup. Just in case someone wants to try,
    the field to rename is in sys/bio.h

    --- sys/bio.h 31 Jan 2005 23:26:55 -0000 1.139.2.4
    +++ sys/bio.h 20 Jul 2005 17:42:31 -0000
    @@ -103,18 +103,62 @@
     struct devstat;

     struct bio_queue_head {
    - TAILQ_HEAD(bio_queue, bio) queue;
    + TAILQ_HEAD(_1, bio) queue;
            off_t last_offset;
            struct bio *insert_point;
            struct bio *switch_point;

    and there seems to be only one offending instance in HEAD/RELENG_6
    kern/subr_disk.c:163:
    - bq = TAILQ_LAST(&bioq->queue, bio_queue);
    + bq = TAILQ_LAST(&bioq->queue, _1);

    and two more in RELENG_5, also in kern/subr_disk.c
    in bioq_remove()
    - head->insert_point = TAILQ_PREV(bp, bio_queue, bio_queue);
    + head->insert_point = TAILQ_PREV(bp, _1, bio_queue);

    @@ -199,7 +203,7 @@
                    } else {
                            if (bioq->switch_point != NULL)
                                    be = TAILQ_PREV(bioq->switch_point,
    - bio_queue, bio_queue);
    + _1, bio_queue);
                            /*
                             * If we lie between last_offset and bq,
                             * insert before bq.

    The offending macros are TAILQ_LAST() and TAILQ_PREV() and their users

    TAILQ_FOREACH_REVERSE
    TAILQ_FOREACH_REVERSE_SAFE

    cheers
    luigi

    > --
    > Poul-Henning Kamp | UNIX since Zilog Zeus 3.20
    > phk@FreeBSD.ORG | TCP/IP since RFC 956
    > FreeBSD committer | BSD since 4.3-tahoe
    > Never attribute to malice what can adequately be explained by incompetence.
    _______________________________________________
    freebsd-current@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-current
    To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"


  • Next message: Marcin Jessa: "Re: FreeBSD6, FSC Lifebook E8010, Xorg"

    Relevant Pages