From af05f073a122b16a9ee5d333b3a39533607f5db8 Mon Sep 17 00:00:00 2001 From: Christoph Lameter Date: Thu, 9 Aug 2007 07:51:49 -0700 Subject: [PATCH] FS: Proc filesystem support for slab defrag Support procfs inode defragmentation Reviewed-by: Rik van Riel Signed-off-by: Christoph Lameter --- fs/proc/inode.c | 8 ++++++++ 1 file changed, 8 insertions(+) Index: linux-2.6.24-rc2-mm1/fs/proc/inode.c =================================================================== --- linux-2.6.24-rc2-mm1.orig/fs/proc/inode.c 2007-11-14 11:08:37.264011681 -0800 +++ linux-2.6.24-rc2-mm1/fs/proc/inode.c 2007-11-14 12:19:50.457593499 -0800 @@ -109,6 +109,12 @@ static void init_once(struct kmem_cache inode_init_once(&ei->vfs_inode); } +static void *proc_get_inodes(struct kmem_cache *s, int nr, void **v) +{ + return fs_get_inodes(s, nr, v, + offsetof(struct proc_inode, vfs_inode)); +}; + int __init proc_init_inodecache(void) { proc_inode_cachep = kmem_cache_create("proc_inode_cache", @@ -116,6 +122,8 @@ int __init proc_init_inodecache(void) 0, (SLAB_RECLAIM_ACCOUNT| SLAB_MEM_SPREAD|SLAB_PANIC), init_once); + kmem_cache_setup_defrag(proc_inode_cachep, + proc_get_inodes, kick_inodes); return 0; }