TAILQ_* ambiguity in sys/sys/bio.h
Luigi Rizzo
rizzo at icir.org
Wed Jul 20 16:23:37 GMT 2005
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
@@ -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 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.
More information about the freebsd-current
mailing list