From 09a7883e3fe7f2ad09605dd704fd137b7053eee7 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/fs/reiserfs/super.c =================================================================== --- linux-2.6.orig/fs/reiserfs/super.c 2008-03-26 17:04:15.637921072 -0700 +++ linux-2.6/fs/reiserfs/super.c 2008-03-26 17:51:20.419168985 -0700 @@ -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; }