lkml.org 
[lkml]   [2008]   [Aug]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch 12/19] Filesystem: Ext2 filesystem defrag
Support defragmentation for ext2 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/ext2/super.c | 9 +++++++++
1 file changed, 9 insertions(+)

Index: linux-next/fs/ext2/super.c
===================================================================
--- linux-next.orig/fs/ext2/super.c 2008-08-11 07:42:10.212350007 -0700
+++ linux-next/fs/ext2/super.c 2008-08-11 07:47:05.022348226 -0700
@@ -171,6 +171,12 @@ static void init_once(void *foo)
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 int init_inodecache(void)
{
ext2_inode_cachep = kmem_cache_create("ext2_inode_cache",
@@ -180,6 +186,9 @@ static int init_inodecache(void)
init_once);
if (ext2_inode_cachep == NULL)
return -ENOMEM;
+
+ kmem_cache_setup_defrag(ext2_inode_cachep,
+ ext2_get_inodes, kick_inodes);
return 0;
}

--


\
 
 \ /
  Last update: 2008-08-11 17:25    [W:0.114 / U:0.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site