Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755822AbYABSoz (ORCPT ); Wed, 2 Jan 2008 13:44:55 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752514AbYABSor (ORCPT ); Wed, 2 Jan 2008 13:44:47 -0500 Received: from extu-mxob-1.symantec.com ([216.10.194.28]:44704 "EHLO extu-mxob-1.symantec.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752448AbYABSor (ORCPT ); Wed, 2 Jan 2008 13:44:47 -0500 Date: Wed, 2 Jan 2008 18:43:19 +0000 (GMT) From: Hugh Dickins X-X-Sender: hugh@blonde.wat.veritas.com To: Linus Torvalds cc: Pekka Enberg , Ingo Molnar , Andi Kleen , Christoph Lameter , Peter Zijlstra , linux-kernel@vger.kernel.org Subject: [PATCH] procfs: provide slub's /proc/slabinfo Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1701 Lines: 48 SLUB's new slabinfo isn't there: it looks as if a last minute change to Pekka's patch left it dependent on CONFIG_SLAB at the procfs end: allow for CONFIG_SLUB too. Signed-off-by: Hugh Dickins --- To minimize ifdeffery, this leaves it with S_IWUSR though unwritable: I'm assuming that's acceptable. fs/proc/proc_misc.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) --- 2.6.24-rc6-git/fs/proc/proc_misc.c 2007-10-20 08:04:13.000000000 +0100 +++ linux/fs/proc/proc_misc.c 2008-01-02 17:55:57.000000000 +0000 @@ -410,15 +410,18 @@ static const struct file_operations proc }; #endif -#ifdef CONFIG_SLAB +#if defined(CONFIG_SLAB) || defined(CONFIG_SLUB) static int slabinfo_open(struct inode *inode, struct file *file) { return seq_open(file, &slabinfo_op); } + static const struct file_operations proc_slabinfo_operations = { .open = slabinfo_open, .read = seq_read, +#ifdef CONFIG_SLAB .write = slabinfo_write, +#endif .llseek = seq_lseek, .release = seq_release, }; @@ -728,7 +731,7 @@ void __init proc_misc_init(void) #endif create_seq_entry("stat", 0, &proc_stat_operations); create_seq_entry("interrupts", 0, &proc_interrupts_operations); -#ifdef CONFIG_SLAB +#if defined(CONFIG_SLAB) || defined(CONFIG_SLUB) create_seq_entry("slabinfo",S_IWUSR|S_IRUGO,&proc_slabinfo_operations); #ifdef CONFIG_DEBUG_SLAB_LEAK create_seq_entry("slab_allocators", 0 ,&proc_slabstats_operations); -- 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/