From owner-freebsd-arch@FreeBSD.ORG Tue Apr 1 08:44:09 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 C5C7137B401 for ; Tue, 1 Apr 2003 08:44:09 -0800 (PST) Received: from mail.speakeasy.net (mail15.speakeasy.net [216.254.0.215]) by mx1.FreeBSD.org (Postfix) with ESMTP id 32AA443FA3 for ; Tue, 1 Apr 2003 08:44:09 -0800 (PST) (envelope-from jhb@FreeBSD.org) Received: (qmail 30228 invoked from network); 1 Apr 2003 16:44:12 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender )encrypted SMTP for ; 1 Apr 2003 16:44:12 -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 h31Gi5Ov019692; Tue, 1 Apr 2003 11:44:05 -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: <200304011622.h31GMM4j036254@grimreaper.grondar.org> Date: Tue, 01 Apr 2003 11:44:06 -0500 (EST) From: John Baldwin To: Mark Murray cc: arch@FreeBSD.org 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:44:10 -0000 On 01-Apr-2003 Mark Murray wrote: > John Baldwin writes: >> >>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. > > Aren't we trying to remove sys/lock.h? If so, cant we move its contents > elsewhere? No. sys/lock.h was renamed to sys/lockmgr.h. Files using lockmgr() should be including sys/lockmgr.h and not depending on the nested include in sys/lock.h as that was only for backwards compat and should go away. sys/lock.h defines things like struct lock_class and flags for struct lock_object as well as prototypes for witness, etc. Basically things that are shared across lock primitive such as mutexes, sx, and eventually lockmgr. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/