Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754269AbZJ2QSt (ORCPT ); Thu, 29 Oct 2009 12:18:49 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753721AbZJ2QSs (ORCPT ); Thu, 29 Oct 2009 12:18:48 -0400 Received: from cantor2.suse.de ([195.135.220.15]:55632 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752950AbZJ2QSr (ORCPT ); Thu, 29 Oct 2009 12:18:47 -0400 Message-ID: <4AE9C0B0.3030304@suse.de> Date: Thu, 29 Oct 2009 17:20:00 +0100 From: Tejun Heo User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Matthew Wilcox Cc: Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Jesse Barnes , linux-pci@vger.kernel.org Subject: Re: [PATCH 2/3] Sysfs: Allow directories to be populated dynamically References: <20091020054740.GC29158@parisc-linux.org> <20091020055021.GE29158@parisc-linux.org> In-Reply-To: <20091020055021.GE29158@parisc-linux.org> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1137 Lines: 32 Hello, > diff --git a/fs/sysfs/sysfs.h b/fs/sysfs/sysfs.h > index af4c4e7..13843fa 100644 > --- a/fs/sysfs/sysfs.h > +++ b/fs/sysfs/sysfs.h > @@ -17,6 +17,9 @@ struct sysfs_elem_dir { > struct kobject *kobj; > /* children list starts here and goes through sd->s_sibling */ > struct sysfs_dirent *children; > + int (*populate)(struct dentry *, struct sysfs_dirent *); > + void (*depopulate)(struct dentry *, struct sysfs_dirent *); > + void *data; This will increase the size of struct sysfs_dirent by three pointers which is considerable. Bloating the size of sysfs_dirent can waste large amount of memory on machines with a lot of disks. The implementation looks quite scary to me. Is this the only way to do this? It it because trying to create individual entries for msix will end up creating too many sysfs entries? If so, how many are we talking about? Thanks. -- tejun -- 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/