From 684ee6838662071d98d541ebcc9dccf1e209329f Mon Sep 17 00:00:00 2001 From: Christoph Lameter Date: Thu, 9 Aug 2007 07:51:49 -0700 Subject: [PATCH] FS: Slab defrag: Reiserfs support Slab defragmentation: Support reiserfs inode defragmentation Reviewed-by: Rik van Riel Signed-off-by: Christoph Lameter --- fs/reiserfs/super.c | 8 ++++++++ 1 file changed, 8 insertions(+) Index: linux-2.6.24-rc2-mm1/fs/reiserfs/super.c =================================================================== --- linux-2.6.24-rc2-mm1.orig/fs/reiserfs/super.c 2007-11-14 11:08:37.584011932 -0800 +++ linux-2.6.24-rc2-mm1/fs/reiserfs/super.c 2007-11-14 12:20:00.713593974 -0800 @@ -532,6 +532,12 @@ static void init_once(struct kmem_cache #endif } +static void *reiserfs_get_inodes(struct kmem_cache *s, int nr, void **v) +{ + return fs_get_inodes(s, nr, v, + offsetof(struct reiserfs_inode_info, vfs_inode)); +} + static int init_inodecache(void) { reiserfs_inode_cachep = kmem_cache_create("reiser_inode_cache", @@ -542,6 +548,8 @@ static int init_inodecache(void) init_once); if (reiserfs_inode_cachep == NULL) return -ENOMEM; + kmem_cache_setup_defrag(reiserfs_inode_cachep, + reiserfs_get_inodes, kick_inodes); return 0; }