From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Lameter Subject: [patch 14/21] Filesystem: Ext4 filesystem defrag Date: Fri, 09 May 2008 20:08:45 -0700 Message-ID: <20080510030917.912938675@sgi.com> References: <20080510030831.796641881@sgi.com> Cc: linux-kernel@vger.kernel.org To: akpm@linux-foundation.org Return-path: Received: from netops-testserver-3-out.sgi.com ([192.48.171.28]:55048 "EHLO relay.sgi.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752098AbYEJDJT (ORCPT ); Fri, 9 May 2008 23:09:19 -0400 CC: linux-fsdevel@vger.kernel.org Cc: Mel Gorman Cc: andi@firstfloor.org Cc: Rik van Riel Cc: Pekka Enberg Cc: mpm@selenic.com Content-Disposition: inline; filename=ext4-defrag Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Support defragmentation for extX filesystem inodes Reviewed-by: Rik van Riel Signed-off-by: Christoph Lameter --- fs/ext4/super.c | 8 ++++++++ 1 file changed, 8 insertions(+) Index: linux-2.6/fs/ext4/super.c =================================================================== --- linux-2.6.orig/fs/ext4/super.c 2008-05-07 21:23:41.961409593 -0700 +++ linux-2.6/fs/ext4/super.c 2008-05-07 21:27:18.215159859 -0700 @@ -599,6 +599,12 @@ static void init_once(struct kmem_cache 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)); +} + static int init_inodecache(void) { ext4_inode_cachep = kmem_cache_create("ext4_inode_cache", @@ -608,6 +614,8 @@ static int init_inodecache(void) init_once); if (ext4_inode_cachep == NULL) return -ENOMEM; + kmem_cache_setup_defrag(ext4_inode_cachep, + ext4_get_inodes, kick_inodes); return 0; } --