From owner-freebsd-current Fri Nov 22 10:52: 2 2002 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 0CB4337B404 for ; Fri, 22 Nov 2002 10:52:01 -0800 (PST) Received: from mail.speakeasy.net (mail14.speakeasy.net [216.254.0.214]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1A57A43EB2 for ; Fri, 22 Nov 2002 10:52:00 -0800 (PST) (envelope-from jhb@FreeBSD.org) Received: (qmail 1237 invoked from network); 22 Nov 2002 18:13:32 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) by mail14.speakeasy.net (qmail-ldap-1.03) with DES-CBC3-SHA encrypted SMTP for ; 22 Nov 2002 18:13:32 -0000 Received: from laptop.baldwin.cx (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.12.6/8.12.6) with ESMTP id gAMIDP2D043205; Fri, 22 Nov 2002 13:13:25 -0500 (EST) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.2 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: Date: Fri, 22 Nov 2002 13:13:30 -0500 (EST) From: John Baldwin To: Robert Watson Subject: Re: mbuf header bloat ? Cc: current@freebsd.org, Luigi Rizzo Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 22-Nov-2002 Robert Watson wrote: > > On Thu, 21 Nov 2002, Luigi Rizzo wrote: > >> [Bcc to -net because it is relevant there. This email has been triggered >> by a private discussion i was having with other committers (who will >> easily recognise themselves :) which suggested the possibility of adding >> more fields to mbuf headers] >> >> Just recently came up to my attention that we have the following code in >> >> >> #define MAC_MAX_POLICIES 4 >> struct label { >> int l_flags; >> union { >> void *l_ptr; >> long l_long; >> } l_perpolicy[MAC_MAX_POLICIES]; >> }; >> >> (what are l_perpolicy[], ints ? Could this be written a bit better ?) >> and then in > > MAC labels provide general purpose security label storage across a variety > of kernel objects. Each MAC label is made up of a number of "slots" which > are allocated to statically linked or dynamically loaded policies. The > union is used to allow policies to use their slot for either the purposes > of an integer store, or as a pointer with the semantics they define. Some > policies simply use the long to represent their policy information, > perhaps by itself (a partition number), or to key into an existing array. > Other policies use the pointer to point to shared reference-counted, > static, or per-label data. Probably the "long" should be changed to some > other integer type that better matches the notion of pointer length. intptr_t. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message