From owner-freebsd-current@FreeBSD.ORG Wed Jul 20 15:39:44 2005 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4015816A41F for ; Wed, 20 Jul 2005 15:39:44 +0000 (GMT) (envelope-from rizzo@icir.org) Received: from xorpc.icir.org (xorpc.icir.org [192.150.187.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1299A43D48 for ; Wed, 20 Jul 2005 15:39:43 +0000 (GMT) (envelope-from rizzo@icir.org) Received: from xorpc.icir.org (localhost [127.0.0.1]) by xorpc.icir.org (8.12.11/8.12.11) with ESMTP id j6KFdgCq035343; Wed, 20 Jul 2005 08:39:42 -0700 (PDT) (envelope-from rizzo@xorpc.icir.org) Received: (from rizzo@localhost) by xorpc.icir.org (8.12.11/8.12.3/Submit) id j6KFdgLF035342; Wed, 20 Jul 2005 08:39:42 -0700 (PDT) (envelope-from rizzo) Date: Wed, 20 Jul 2005 08:39:42 -0700 From: Luigi Rizzo To: current@freebsd.org Message-ID: <20050720083942.A35046@xorpc.icir.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i Cc: Subject: TAILQ_* ambiguity in sys/sys/bio.h X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jul 2005 15:39:44 -0000 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