Slab defragmentation: Support inode defragmentation for xfs Add slab defrag support. Signed-off-by: Christoph Lameter --- fs/xfs/linux-2.6/xfs_super.c | 6 ++++++ 1 file changed, 6 insertions(+) Index: linux-2.6/fs/xfs/linux-2.6/xfs_super.c =================================================================== --- linux-2.6.orig/fs/xfs/linux-2.6/xfs_super.c 2007-07-29 13:59:35.000000000 -0700 +++ linux-2.6/fs/xfs/linux-2.6/xfs_super.c 2007-07-29 14:41:40.000000000 -0700 @@ -363,6 +363,11 @@ xfs_fs_inode_init_once( inode_init_once(vn_to_inode((bhv_vnode_t *)vnode)); } +static void *xfs_get_inodes(struct kmem_cache *s, int nr, void **v) +{ + return fs_get_inodes(s, nr, v, offsetof(bhv_vnode_t, v_inode)); +}; + STATIC int xfs_init_zones(void) { @@ -376,6 +381,7 @@ xfs_init_zones(void) xfs_ioend_zone = kmem_zone_init(sizeof(xfs_ioend_t), "xfs_ioend"); if (!xfs_ioend_zone) goto out_destroy_vnode_zone; + kmem_cache_setup_defrag(xfs_vnode_zone, xfs_get_inodes, kick_inodes); xfs_ioend_pool = mempool_create_slab_pool(4 * MAX_BUF_PER_PAGE, xfs_ioend_zone);