[patch 14/19] Filesystem: Ext4 filesystem defrag

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Pekka Enberg <penberg@...>
Cc: <akpm@...>, Christoph Lameter <clameter@...>, Christoph Lameter <cl@...>, <linux-kernel@...>, <linux-fsdevel@...>, Mel Gorman <mel@...>, <andi@...>, Rik van Riel <riel@...>, <mpm@...>, Dave Chinner <david@...>
Date: Friday, May 9, 2008 - 10:21 pm

Support defragmentation for extX filesystem inodes

Reviewed-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Christoph Lameter <cl@linux-foundation.org>

---
 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-07-31 12:18:12.000000000 -0500
+++ linux-2.6/fs/ext4/super.c	2008-07-31 12:18:15.000000000 -0500
@@ -607,6 +607,12 @@
 	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",
@@ -616,6 +622,8 @@
 					     init_once);
 	if (ext4_inode_cachep == NULL)
 		return -ENOMEM;
+	kmem_cache_setup_defrag(ext4_inode_cachep,
+			ext4_get_inodes, kick_inodes);
 	return 0;
 }
 

-- 
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/2] New split of quota headers, Jan Kara, (Thu Jun 5, 8:42 am)
[patch 14/19] Filesystem: Ext4 filesystem defrag, Christoph Lameter, (Fri May 9, 10:21 pm)
Re: [patch 14/19] Filesystem: Ext4 filesystem defrag, Theodore Tso, (Sat Aug 2, 9:54 pm)
Re: [patch 14/19] Filesystem: Ext4 filesystem defrag, Pekka Enberg, (Wed Aug 13, 3:26 am)