lkml.org 
[lkml]   [2008]   [Aug]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch 16/19] Filesystem: /proc filesystem support for slab defrag
Support procfs inode defragmentation

Cc: Alexey Dobriyan <adobriyan@sw.ru>
Reviewed-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Christoph Lameter <cl@linux-foundation.org>

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

Index: linux-next/fs/proc/inode.c
===================================================================
--- linux-next.orig/fs/proc/inode.c 2008-08-11 07:42:11.542357951 -0700
+++ linux-next/fs/proc/inode.c 2008-08-11 07:47:05.102359374 -0700
@@ -106,6 +106,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));
+};
+
int __init proc_init_inodecache(void)
{
proc_inode_cachep = kmem_cache_create("proc_inode_cache",
@@ -113,6 +119,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;
}

--


\
 
 \ /
  Last update: 2008-08-11 17:27    [W:0.112 / U:0.780 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site