Slab defragmentation: Support reiserfs inode defragmentation

Reviewed-by: Rik van Riel <[EMAIL PROTECTED]>
Signed-off-by: Christoph Lameter <[EMAIL PROTECTED]>
---
 fs/reiserfs/super.c |    8 ++++++++
 1 file changed, 8 insertions(+)

Index: linux-2.6.23-mm1/fs/reiserfs/super.c
===================================================================
--- linux-2.6.23-mm1.orig/fs/reiserfs/super.c   2007-10-12 16:26:09.000000000 
-0700
+++ linux-2.6.23-mm1/fs/reiserfs/super.c        2007-10-12 18:48:36.000000000 
-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;
 }
 

-- 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to