TAILQ_* ambiguity in sys/sys/bio.h

From: Luigi Rizzo <rizzo_at_icir.org>
Date: Wed, 20 Jul 2005 08:39:42 -0700
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
Received on Wed Jul 20 2005 - 13:39:44 UTC

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