2010-01-29 20:52:13

by Christoph Lameter

[permalink] [raw]
Subject: Filesystems: /proc filesystem support for slab defrag

Support procfs inode defragmentation

Cc: Alexey Dobriyan <[email protected]>
Reviewed-by: Rik van Riel <[email protected]>
Signed-off-by: Christoph Lameter <[email protected]>
Signed-off-by: Christoph Lameter <[email protected]>

---
fs/proc/inode.c | 8 ++++++++
1 file changed, 8 insertions(+)

Index: linux-2.6/fs/proc/inode.c
===================================================================
--- linux-2.6.orig/fs/proc/inode.c 2009-12-18 13:13:24.000000000 -0600
+++ linux-2.6/fs/proc/inode.c 2010-01-29 10:33:22.000000000 -0600
@@ -77,6 +77,12 @@ static void init_once(void *foo)
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));
+}
+
void __init proc_init_inodecache(void)
{
proc_inode_cachep = kmem_cache_create("proc_inode_cache",
@@ -84,6 +90,8 @@ void __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)
}

static const struct super_operations proc_sops = {

--