Slab defragmentation: Support defragmentation for extX filesystem inodes Signed-off-by: Christoph Lameter --- fs/ext2/super.c | 10 +++++++++- fs/ext3/super.c | 10 +++++++++- fs/ext4/super.c | 10 +++++++++- 3 files changed, 27 insertions(+), 3 deletions(-) Index: linux-2.6.23-rc1/fs/ext2/super.c =================================================================== --- linux-2.6.23-rc1.orig/fs/ext2/super.c 2007-07-27 23:58:04.000000000 -0700 +++ linux-2.6.23-rc1/fs/ext2/super.c 2007-07-27 23:58:47.000000000 -0700 @@ -168,8 +168,16 @@ static void init_once(void * foo, struct inode_init_once(&ei->vfs_inode); } +static void *ext2_get_inodes(struct kmem_cache *s, int nr, void **v) +{ + return fs_get_inodes(s, nr, v, + offsetof(struct ext2_inode_info, vfs_inode)); +} + static struct kmem_cache_ops init_once_cache_ops = { - .ctor = init_once + .ctor = init_once, + .get = ext2_get_inodes, + .kick = kick_inodes }; static int init_inodecache(void) Index: linux-2.6.23-rc1/fs/ext3/super.c =================================================================== --- linux-2.6.23-rc1.orig/fs/ext3/super.c 2007-07-27 23:58:04.000000000 -0700 +++ linux-2.6.23-rc1/fs/ext3/super.c 2007-07-27 23:58:47.000000000 -0700 @@ -484,8 +484,16 @@ static void init_once(void * foo, struct inode_init_once(&ei->vfs_inode); } +static void *ext3_get_inodes(struct kmem_cache *s, int nr, void **v) +{ + return fs_get_inodes(s, nr, v, + offsetof(struct ext3_inode_info, vfs_inode)); +} + static struct kmem_cache_ops init_once_cache_ops = { - .ctor = init_once + .ctor = init_once, + .get = ext3_get_inodes, + .kick = kick_inodes }; static int init_inodecache(void) Index: linux-2.6.23-rc1/fs/ext4/super.c =================================================================== --- linux-2.6.23-rc1.orig/fs/ext4/super.c 2007-07-27 23:58:53.000000000 -0700 +++ linux-2.6.23-rc1/fs/ext4/super.c 2007-07-27 23:59:47.000000000 -0700 @@ -535,8 +535,16 @@ static void init_once(void * foo, struct inode_init_once(&ei->vfs_inode); } +static void *ext4_get_inodes(struct kmem_cache *s, int nr, void **v) +{ + return fs_get_inodes(s, nr, v, + offsetof(struct ext4_inode_info, vfs_inode)); +} + struct init_once_cache_ops = { - .ctor = init_once + .ctor = init_once, + .get = ext4_get_inodes, + .kick = kick_inodes }; static int init_inodecache(void)