--- fs/ext3/ialloc.c | 7 ++++++- fs/ext3/super.c | 16 +--------------- fs/inode.c | 13 +++++++++++++ include/linux/fs.h | 1 + 4 files changed, 21 insertions(+), 16 deletions(-) Index: 26-mm/fs/inode.c =================================================================== --- 26-mm.orig/fs/inode.c 2007-05-03 20:39:46.000000000 +0300 +++ 26-mm/fs/inode.c 2007-05-03 20:41:31.000000000 +0300 @@ -570,6 +570,19 @@ EXPORT_SYMBOL(new_inode); +struct inode *new_inode_init(struct super_block *sb) +{ + struct inode *inode; + + inode = new_inode(sb); + if (inode) + inode_init_once(inode); + + return inode; +} + +EXPORT_SYMBOL(new_inode_init); + void unlock_new_inode(struct inode *inode) { /* Index: 26-mm/include/linux/fs.h =================================================================== --- 26-mm.orig/include/linux/fs.h 2007-05-03 20:41:34.000000000 +0300 +++ 26-mm/include/linux/fs.h 2007-05-03 20:41:55.000000000 +0300 @@ -1744,6 +1744,7 @@ extern void clear_inode(struct inode *); extern void destroy_inode(struct inode *); extern struct inode *new_inode(struct super_block *); +extern struct inode *new_inode_init(struct super_block *); extern int __remove_suid(struct dentry *, int); extern int should_remove_suid(struct dentry *); extern int remove_suid(struct dentry *); Index: 26-mm/fs/ext3/ialloc.c =================================================================== --- 26-mm.orig/fs/ext3/ialloc.c 2007-05-03 20:39:31.000000000 +0300 +++ 26-mm/fs/ext3/ialloc.c 2007-05-03 20:43:25.000000000 +0300 @@ -442,10 +442,15 @@ return ERR_PTR(-EPERM); sb = dir->i_sb; - inode = new_inode(sb); + inode = new_inode_init(sb); if (!inode) return ERR_PTR(-ENOMEM); ei = EXT3_I(inode); + INIT_LIST_HEAD(&ei->i_orphan); +#ifdef CONFIG_EXT3_FS_XATTR + init_rwsem(&ei->xattr_sem); +#endif + mutex_init(&ei->truncate_mutex); sbi = EXT3_SB(sb); es = sbi->s_es; Index: 26-mm/fs/ext3/super.c =================================================================== --- 26-mm.orig/fs/ext3/super.c 2007-05-03 20:39:12.000000000 +0300 +++ 26-mm/fs/ext3/super.c 2007-05-03 20:43:43.000000000 +0300 @@ -462,27 +462,13 @@ kmem_cache_free(ext3_inode_cachep, EXT3_I(inode)); } -static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flags) -{ - struct ext3_inode_info *ei = (struct ext3_inode_info *) foo; - - if (flags & SLAB_CTOR_CONSTRUCTOR) { - INIT_LIST_HEAD(&ei->i_orphan); -#ifdef CONFIG_EXT3_FS_XATTR - init_rwsem(&ei->xattr_sem); -#endif - mutex_init(&ei->truncate_mutex); - inode_init_once(&ei->vfs_inode); - } -} - static int init_inodecache(void) { ext3_inode_cachep = kmem_cache_create("ext3_inode_cache", sizeof(struct ext3_inode_info), 0, (SLAB_RECLAIM_ACCOUNT| SLAB_MEM_SPREAD), - init_once, NULL); + NULL, NULL); if (ext3_inode_cachep == NULL) return -ENOMEM; return 0;