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

From: Luigi Rizzo <rizzo_at_icir.org>
Date: Wed, 20 Jul 2005 09:23:36 -0700
On Wed, Jul 20, 2005 at 05:49:57PM +0200, Poul-Henning Kamp wrote:
> In message <20050720083942.A35046_at_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
_at__at_ -103,18 +103,62 _at__at_
 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);

_at__at_ -199,7 +203,7 _at__at_
                } 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_at_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.
Received on Wed Jul 20 2005 - 14:23:37 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:39 UTC