Date: Wed, 20 Jul 2005 08:39:42 -0700 From: Luigi Rizzo <rizzo@icir.org> To: current@freebsd.org Subject: TAILQ_* ambiguity in sys/sys/bio.h Message-ID: <20050720083942.A35046@xorpc.icir.org>
next in thread | raw e-mail | index | archive | help
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 We have struct bio_queue_head { TAILQ_HEAD(bio_queue, bio) queue; off_t last_offset; struct bio *insert_point; }; where the "bio_queue" name refers to a name of an internally declared structure whose only instance is 'queue', and then we have struct bio { ... TAILQ_ENTRY(bio) bio_queue; /* Disksort queue. */ ... } where bio_queue is a field name. An example where the confusion is evident is this line in kern/subr_disk.c::bioq_remove() head->insert_point = TAILQ_PREV(bp, bio_queue, bio_queue); where the former 'bio_queue' is a type name, and the second a field name. Any objection to remove the ambiguity by renaming the type name in struct bio_queue_head to something else ? (ideally i'd rather not use a name at all, but apparently some of the TAILQ_ macros do require a name for this struct even though it's unambiguous once you know it's a TAILQ). cheers luigi
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050720083942.A35046>