From 017ef3fb109797f01b3fa1aad1fbb13a5aec2741 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 files changed, 8 insertions(+), 0 deletions(-) diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c index 393cc22..69b4a86 100644 --- a/fs/reiserfs/super.c +++ b/fs/reiserfs/super.c @@ -532,6 +532,12 @@ static void init_once(struct kmem_cache * cachep, void *foo) #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; } -- 1.5.4.4