Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756049AbXKVDDY (ORCPT ); Wed, 21 Nov 2007 22:03:24 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751182AbXKVDDO (ORCPT ); Wed, 21 Nov 2007 22:03:14 -0500 Received: from pentafluge.infradead.org ([213.146.154.40]:59676 "EHLO pentafluge.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751153AbXKVDDM (ORCPT ); Wed, 21 Nov 2007 22:03:12 -0500 Date: Wed, 21 Nov 2007 19:03:04 -0800 From: Arjan van de Ven To: Andi Kleen Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, sam@ravnborg.org, rusty@rustcorp.com.au Subject: Re: [PATCH RFC] [1/9] Core module symbol namespaces code and intro. Message-ID: <20071121190304.6bf682b5@laptopd505.fenrus.org> In-Reply-To: <20071122343.446909000@suse.de> References: <20071122343.446909000@suse.de> Organization: Intel X-Mailer: Claws Mail 3.0.2 (GTK+ 2.12.1; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-SRS-Rewrite: SMTP reverse-path rewritten from by pentafluge.infradead.org See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2150 Lines: 58 On Thu, 22 Nov 2007 03:43:06 +0100 (CET) Andi Kleen wrote: > > There seems to be rough consensus that the kernel currently has too > many exported symbols. A lot of these exports are generally usable > utility functions or important driver interfaces; but another large > part are functions intended by only one or two very specific modules > for a very specific purpose. One example is the TCP code. It has most > of its internals exported, but only for use by tcp_ipv6.c (and now a > few more by the TCP/IP congestion modules) But it doesn't make sense > to include these exported for a specific module functions into a > broader "kernel interface". External modules assume they can use > these functions, but they were never intended for that. > > This patch allows to export symbols only for specific modules by > introducing symbol name spaces. A module name space has a white > list of modules that are allowed to import symbols for it; all others > can't use the symbols. > > It adds two new macros: > > MODULE_NAMESPACE_ALLOW(namespace, module); > > Allow module to import symbols from namespace. module is the module > name without .ko as displayed by lsmod. Must be in the same module > as the export (and be duplicated if there are multiple modules > exporting symbols to a namespace). Multiple allows for the same name > space are allowed. > > EXPORT_SYMBOL_NS(namespace, symbol); > Hi, I like this concept in general; I have one minor comment; right now your namespace argument is like EXPORT_SYMBOL_NS(foo, some_symbol); from a language-like pov I kinda wonder if it's nicer to do EXPORT_SYMBOL_NS("foo", some_symbol); because foo isn't something in C scope, but more a string-like identifier... -- If you want to reach me at my work email, use arjan@linux.intel.com For development, discussion and tips for power savings, visit http://www.lesswatts.org - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/