From owner-freebsd-arch@FreeBSD.ORG Tue Apr 1 08:04:52 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B4A0237B401 for ; Tue, 1 Apr 2003 08:04:52 -0800 (PST) Received: from mail.speakeasy.net (mail13.speakeasy.net [216.254.0.213]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1F08A43F75 for ; Tue, 1 Apr 2003 08:04:52 -0800 (PST) (envelope-from jhb@FreeBSD.org) Received: (qmail 4500 invoked from network); 1 Apr 2003 16:04:54 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender )encrypted SMTP for ; 1 Apr 2003 16:04:54 -0000 Received: from laptop.baldwin.cx (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.12.8/8.12.8) with ESMTP id h31G4mOv019578; Tue, 1 Apr 2003 11:04:48 -0500 (EST) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.4 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <31614.1049186650@critter.freebsd.dk> Date: Tue, 01 Apr 2003 11:04:49 -0500 (EST) From: John Baldwin To: Poul-Henning Kamp cc: arch@freebsd.org cc: Mark Murray Subject: Re: #include and X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2003 16:04:53 -0000 On 01-Apr-2003 Poul-Henning Kamp wrote: > In message <200304010837.h318bZ4j060918@grimreaper.grondar.org>, Mark Murray wr > ites: >>Poul-Henning Kamp writes: >>> My present predicament is that I will probably put a mutex in the >>> bio queue which is defined in , and so far, I've found >>> 20 .c files where I need to add and and >>> I am not yet at a point where LINT compiles. >>> >>> Do we have a plan for these in the future ? I can see three obvious >>> options: >>> >>> A) define them leaf #includes, and #include them from the majority of >>> our .c files. >>> >>> B) Include them nested from other .h files which need them, in my >>> case >>> >>> C) Include them nested from a central .h file like >> >>Do you need the whole sys/lock.h and sys/mutex.h? Can you get by with >>#including sys/_lock.h and/or sys/_mutex.h in sys/bio.h? And possibly >>following up by adding the non-underscore variants in the hopefully >>few places where they are actually needed. > > I can probably get away with the _* versions, but I'd prefer to know > what our plans for this sort of situation actually is... The _lock.h and _mutex.h were the plan and are suitable for nesting in other headers such as sys/bio.h when needed. sys/lock.h and sys/mutex.h should only be included when you need the actual API's rather than just the structure definitions. As another argument, I wouldn't mind having sys/mutex.h and sys/sx.h include sys/lock.h but I'm not sure bde@ would like that. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/