aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2007-05-17 11:36:59 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2007-05-17 11:36:59 -0400
commitdd504ea16f34a29da4aa933ae7ab917fcfd25fd7 (patch)
tree0502645dc159be29c33c992e9e56dc3156074279 /fs
parent5cf4cf65a8ccca44ec9b357ebdb2b517269d7e8a (diff)
parent0479ea0eab197b3e5d4c731f526c02e5e3fbfbd0 (diff)
Merge branch 'master' of /home/trondmy/repositories/git/linux-2.6/
Diffstat (limited to 'fs')
-rw-r--r--fs/adfs/super.c3
-rw-r--r--fs/affs/super.c8
-rw-r--r--fs/afs/super.c20
-rw-r--r--fs/befs/linuxvfs.c6
-rw-r--r--fs/bfs/inode.c3
-rw-r--r--fs/block_dev.c16
-rw-r--r--fs/buffer.c25
-rw-r--r--fs/cifs/cifsfs.c6
-rw-r--r--fs/coda/inode.c3
-rw-r--r--fs/compat.c13
-rw-r--r--fs/dquot.c2
-rw-r--r--fs/ecryptfs/main.c3
-rw-r--r--fs/ecryptfs/mmap.c14
-rw-r--r--fs/efs/super.c3
-rw-r--r--fs/exec.c4
-rw-r--r--fs/ext2/super.c8
-rw-r--r--fs/ext3/super.c10
-rw-r--r--fs/ext4/super.c10
-rw-r--r--fs/fat/cache.c3
-rw-r--r--fs/fat/inode.c14
-rw-r--r--fs/fuse/inode.c3
-rw-r--r--fs/gfs2/main.c34
-rw-r--r--fs/hfs/super.c3
-rw-r--r--fs/hfsplus/super.c3
-rw-r--r--fs/hpfs/super.c8
-rw-r--r--fs/hugetlbfs/inode.c3
-rw-r--r--fs/inode.c3
-rw-r--r--fs/isofs/inode.c3
-rw-r--r--fs/jffs2/super.c6
-rw-r--r--fs/jfs/jfs_metapage.c18
-rw-r--r--fs/jfs/super.c22
-rw-r--r--fs/locks.c3
-rw-r--r--fs/minix/inode.c3
-rw-r--r--fs/ncpfs/inode.c6
-rw-r--r--fs/nfs/inode.c28
-rw-r--r--fs/ntfs/super.c3
-rw-r--r--fs/ocfs2/dlm/dlmfs.c8
-rw-r--r--fs/ocfs2/super.c38
-rw-r--r--fs/openpromfs/inode.c3
-rw-r--r--fs/proc/inode.c3
-rw-r--r--fs/qnx4/inode.c3
-rw-r--r--fs/quota.c23
-rw-r--r--fs/reiserfs/super.c10
-rw-r--r--fs/romfs/inode.c7
-rw-r--r--fs/smbfs/inode.c3
-rw-r--r--fs/sysv/inode.c3
-rw-r--r--fs/udf/super.c6
-rw-r--r--fs/ufs/super.c3
-rw-r--r--fs/xfs/linux-2.6/xfs_super.c3
49 files changed, 167 insertions, 269 deletions
diff --git a/fs/adfs/super.c b/fs/adfs/super.c
index 30c296508497..de2ed5ca3351 100644
--- a/fs/adfs/super.c
+++ b/fs/adfs/super.c
@@ -232,8 +232,7 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
232{ 232{
233 struct adfs_inode_info *ei = (struct adfs_inode_info *) foo; 233 struct adfs_inode_info *ei = (struct adfs_inode_info *) foo;
234 234
235 if (flags & SLAB_CTOR_CONSTRUCTOR) 235 inode_init_once(&ei->vfs_inode);
236 inode_init_once(&ei->vfs_inode);
237} 236}
238 237
239static int init_inodecache(void) 238static int init_inodecache(void)
diff --git a/fs/affs/super.c b/fs/affs/super.c
index beff7d21e6e2..b800d451cd60 100644
--- a/fs/affs/super.c
+++ b/fs/affs/super.c
@@ -87,11 +87,9 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
87{ 87{
88 struct affs_inode_info *ei = (struct affs_inode_info *) foo; 88 struct affs_inode_info *ei = (struct affs_inode_info *) foo;
89 89
90 if (flags & SLAB_CTOR_CONSTRUCTOR) { 90 init_MUTEX(&ei->i_link_lock);
91 init_MUTEX(&ei->i_link_lock); 91 init_MUTEX(&ei->i_ext_lock);
92 init_MUTEX(&ei->i_ext_lock); 92 inode_init_once(&ei->vfs_inode);
93 inode_init_once(&ei->vfs_inode);
94 }
95} 93}
96 94
97static int init_inodecache(void) 95static int init_inodecache(void)
diff --git a/fs/afs/super.c b/fs/afs/super.c
index 370cecc910db..8d47ad88a093 100644
--- a/fs/afs/super.c
+++ b/fs/afs/super.c
@@ -451,17 +451,15 @@ static void afs_i_init_once(void *_vnode, struct kmem_cache *cachep,
451{ 451{
452 struct afs_vnode *vnode = _vnode; 452 struct afs_vnode *vnode = _vnode;
453 453
454 if (flags & SLAB_CTOR_CONSTRUCTOR) { 454 memset(vnode, 0, sizeof(*vnode));
455 memset(vnode, 0, sizeof(*vnode)); 455 inode_init_once(&vnode->vfs_inode);
456 inode_init_once(&vnode->vfs_inode); 456 init_waitqueue_head(&vnode->update_waitq);
457 init_waitqueue_head(&vnode->update_waitq); 457 mutex_init(&vnode->permits_lock);
458 mutex_init(&vnode->permits_lock); 458 mutex_init(&vnode->validate_lock);
459 mutex_init(&vnode->validate_lock); 459 spin_lock_init(&vnode->writeback_lock);
460 spin_lock_init(&vnode->writeback_lock); 460 spin_lock_init(&vnode->lock);
461 spin_lock_init(&vnode->lock); 461 INIT_LIST_HEAD(&vnode->writebacks);
462 INIT_LIST_HEAD(&vnode->writebacks); 462 INIT_WORK(&vnode->cb_broken_work, afs_broken_callback_work);
463 INIT_WORK(&vnode->cb_broken_work, afs_broken_callback_work);
464 }
465} 463}
466 464
467/* 465/*
diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c
index fe96108a788d..a5c5171c2828 100644
--- a/fs/befs/linuxvfs.c
+++ b/fs/befs/linuxvfs.c
@@ -292,10 +292,8 @@ befs_destroy_inode(struct inode *inode)
292static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flags) 292static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flags)
293{ 293{
294 struct befs_inode_info *bi = (struct befs_inode_info *) foo; 294 struct befs_inode_info *bi = (struct befs_inode_info *) foo;
295 295
296 if (flags & SLAB_CTOR_CONSTRUCTOR) { 296 inode_init_once(&bi->vfs_inode);
297 inode_init_once(&bi->vfs_inode);
298 }
299} 297}
300 298
301static void 299static void
diff --git a/fs/bfs/inode.c b/fs/bfs/inode.c
index edc08d89aabc..58c7bd9f5301 100644
--- a/fs/bfs/inode.c
+++ b/fs/bfs/inode.c
@@ -248,8 +248,7 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
248{ 248{
249 struct bfs_inode_info *bi = foo; 249 struct bfs_inode_info *bi = foo;
250 250
251 if (flags & SLAB_CTOR_CONSTRUCTOR) 251 inode_init_once(&bi->vfs_inode);
252 inode_init_once(&bi->vfs_inode);
253} 252}
254 253
255static int init_inodecache(void) 254static int init_inodecache(void)
diff --git a/fs/block_dev.c b/fs/block_dev.c
index 742899240872..ea1480a16f51 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -458,17 +458,15 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
458 struct bdev_inode *ei = (struct bdev_inode *) foo; 458 struct bdev_inode *ei = (struct bdev_inode *) foo;
459 struct block_device *bdev = &ei->bdev; 459 struct block_device *bdev = &ei->bdev;
460 460
461 if (flags & SLAB_CTOR_CONSTRUCTOR) { 461 memset(bdev, 0, sizeof(*bdev));
462 memset(bdev, 0, sizeof(*bdev)); 462 mutex_init(&bdev->bd_mutex);
463 mutex_init(&bdev->bd_mutex); 463 sema_init(&bdev->bd_mount_sem, 1);
464 sema_init(&bdev->bd_mount_sem, 1); 464 INIT_LIST_HEAD(&bdev->bd_inodes);
465 INIT_LIST_HEAD(&bdev->bd_inodes); 465 INIT_LIST_HEAD(&bdev->bd_list);
466 INIT_LIST_HEAD(&bdev->bd_list);
467#ifdef CONFIG_SYSFS 466#ifdef CONFIG_SYSFS
468 INIT_LIST_HEAD(&bdev->bd_holder_list); 467 INIT_LIST_HEAD(&bdev->bd_holder_list);
469#endif 468#endif
470 inode_init_once(&ei->vfs_inode); 469 inode_init_once(&ei->vfs_inode);
471 }
472} 470}
473 471
474static inline void __bd_forget(struct inode *inode) 472static inline void __bd_forget(struct inode *inode)
diff --git a/fs/buffer.c b/fs/buffer.c
index aecd057cd0e0..49590d590d7d 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -981,7 +981,8 @@ grow_dev_page(struct block_device *bdev, sector_t block,
981 struct page *page; 981 struct page *page;
982 struct buffer_head *bh; 982 struct buffer_head *bh;
983 983
984 page = find_or_create_page(inode->i_mapping, index, GFP_NOFS); 984 page = find_or_create_page(inode->i_mapping, index,
985 mapping_gfp_mask(inode->i_mapping) & ~__GFP_FS);
985 if (!page) 986 if (!page)
986 return NULL; 987 return NULL;
987 988
@@ -2898,8 +2899,9 @@ static void recalc_bh_state(void)
2898 2899
2899struct buffer_head *alloc_buffer_head(gfp_t gfp_flags) 2900struct buffer_head *alloc_buffer_head(gfp_t gfp_flags)
2900{ 2901{
2901 struct buffer_head *ret = kmem_cache_alloc(bh_cachep, gfp_flags); 2902 struct buffer_head *ret = kmem_cache_zalloc(bh_cachep, gfp_flags);
2902 if (ret) { 2903 if (ret) {
2904 INIT_LIST_HEAD(&ret->b_assoc_buffers);
2903 get_cpu_var(bh_accounting).nr++; 2905 get_cpu_var(bh_accounting).nr++;
2904 recalc_bh_state(); 2906 recalc_bh_state();
2905 put_cpu_var(bh_accounting); 2907 put_cpu_var(bh_accounting);
@@ -2918,17 +2920,6 @@ void free_buffer_head(struct buffer_head *bh)
2918} 2920}
2919EXPORT_SYMBOL(free_buffer_head); 2921EXPORT_SYMBOL(free_buffer_head);
2920 2922
2921static void
2922init_buffer_head(void *data, struct kmem_cache *cachep, unsigned long flags)
2923{
2924 if (flags & SLAB_CTOR_CONSTRUCTOR) {
2925 struct buffer_head * bh = (struct buffer_head *)data;
2926
2927 memset(bh, 0, sizeof(*bh));
2928 INIT_LIST_HEAD(&bh->b_assoc_buffers);
2929 }
2930}
2931
2932static void buffer_exit_cpu(int cpu) 2923static void buffer_exit_cpu(int cpu)
2933{ 2924{
2934 int i; 2925 int i;
@@ -2955,12 +2946,8 @@ void __init buffer_init(void)
2955{ 2946{
2956 int nrpages; 2947 int nrpages;
2957 2948
2958 bh_cachep = kmem_cache_create("buffer_head", 2949 bh_cachep = KMEM_CACHE(buffer_head,
2959 sizeof(struct buffer_head), 0, 2950 SLAB_RECLAIM_ACCOUNT|SLAB_PANIC|SLAB_MEM_SPREAD);
2960 (SLAB_RECLAIM_ACCOUNT|SLAB_PANIC|
2961 SLAB_MEM_SPREAD),
2962 init_buffer_head,
2963 NULL);
2964 2951
2965 /* 2952 /*
2966 * Limit the bh occupancy to 10% of ZONE_NORMAL 2953 * Limit the bh occupancy to 10% of ZONE_NORMAL
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index 8568e100953c..d38c69b591cf 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -701,10 +701,8 @@ cifs_init_once(void *inode, struct kmem_cache * cachep, unsigned long flags)
701{ 701{
702 struct cifsInodeInfo *cifsi = inode; 702 struct cifsInodeInfo *cifsi = inode;
703 703
704 if (flags & SLAB_CTOR_CONSTRUCTOR) { 704 inode_init_once(&cifsi->vfs_inode);
705 inode_init_once(&cifsi->vfs_inode); 705 INIT_LIST_HEAD(&cifsi->lockList);
706 INIT_LIST_HEAD(&cifsi->lockList);
707 }
708} 706}
709 707
710static int 708static int
diff --git a/fs/coda/inode.c b/fs/coda/inode.c
index 0aaff3651d14..dbff1bd4fb96 100644
--- a/fs/coda/inode.c
+++ b/fs/coda/inode.c
@@ -62,8 +62,7 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
62{ 62{
63 struct coda_inode_info *ei = (struct coda_inode_info *) foo; 63 struct coda_inode_info *ei = (struct coda_inode_info *) foo;
64 64
65 if (flags & SLAB_CTOR_CONSTRUCTOR) 65 inode_init_once(&ei->vfs_inode);
66 inode_init_once(&ei->vfs_inode);
67} 66}
68 67
69int coda_init_inodecache(void) 68int coda_init_inodecache(void)
diff --git a/fs/compat.c b/fs/compat.c
index 7b21b0a82596..1de2331db844 100644
--- a/fs/compat.c
+++ b/fs/compat.c
@@ -2230,21 +2230,16 @@ asmlinkage long compat_sys_signalfd(int ufd,
2230asmlinkage long compat_sys_timerfd(int ufd, int clockid, int flags, 2230asmlinkage long compat_sys_timerfd(int ufd, int clockid, int flags,
2231 const struct compat_itimerspec __user *utmr) 2231 const struct compat_itimerspec __user *utmr)
2232{ 2232{
2233 long res;
2234 struct itimerspec t; 2233 struct itimerspec t;
2235 struct itimerspec __user *ut; 2234 struct itimerspec __user *ut;
2236 2235
2237 res = -EFAULT;
2238 if (get_compat_itimerspec(&t, utmr)) 2236 if (get_compat_itimerspec(&t, utmr))
2239 goto err_exit; 2237 return -EFAULT;
2240 ut = compat_alloc_user_space(sizeof(*ut)); 2238 ut = compat_alloc_user_space(sizeof(*ut));
2241 if (copy_to_user(ut, &t, sizeof(t)) ) 2239 if (copy_to_user(ut, &t, sizeof(t)))
2242 goto err_exit; 2240 return -EFAULT;
2243 2241
2244 res = sys_timerfd(ufd, clockid, flags, ut); 2242 return sys_timerfd(ufd, clockid, flags, ut);
2245err_exit:
2246 return res;
2247} 2243}
2248 2244
2249#endif /* CONFIG_TIMERFD */ 2245#endif /* CONFIG_TIMERFD */
2250
diff --git a/fs/dquot.c b/fs/dquot.c
index 3a995841de90..8819d281500c 100644
--- a/fs/dquot.c
+++ b/fs/dquot.c
@@ -1421,7 +1421,7 @@ int vfs_quota_off(struct super_block *sb, int type)
1421 /* If quota was reenabled in the meantime, we have 1421 /* If quota was reenabled in the meantime, we have
1422 * nothing to do */ 1422 * nothing to do */
1423 if (!sb_has_quota_enabled(sb, cnt)) { 1423 if (!sb_has_quota_enabled(sb, cnt)) {
1424 mutex_lock(&toputinode[cnt]->i_mutex); 1424 mutex_lock_nested(&toputinode[cnt]->i_mutex, I_MUTEX_QUOTA);
1425 toputinode[cnt]->i_flags &= ~(S_IMMUTABLE | 1425 toputinode[cnt]->i_flags &= ~(S_IMMUTABLE |
1426 S_NOATIME | S_NOQUOTA); 1426 S_NOATIME | S_NOQUOTA);
1427 truncate_inode_pages(&toputinode[cnt]->i_data, 0); 1427 truncate_inode_pages(&toputinode[cnt]->i_data, 0);
diff --git a/fs/ecryptfs/main.c b/fs/ecryptfs/main.c
index 8cbf3f69ebe5..606128f5c927 100644
--- a/fs/ecryptfs/main.c
+++ b/fs/ecryptfs/main.c
@@ -583,8 +583,7 @@ inode_info_init_once(void *vptr, struct kmem_cache *cachep, unsigned long flags)
583{ 583{
584 struct ecryptfs_inode_info *ei = (struct ecryptfs_inode_info *)vptr; 584 struct ecryptfs_inode_info *ei = (struct ecryptfs_inode_info *)vptr;
585 585
586 if (flags & SLAB_CTOR_CONSTRUCTOR) 586 inode_init_once(&ei->vfs_inode);
587 inode_init_once(&ei->vfs_inode);
588} 587}
589 588
590static struct ecryptfs_cache_info { 589static struct ecryptfs_cache_info {
diff --git a/fs/ecryptfs/mmap.c b/fs/ecryptfs/mmap.c
index 0770c4b66f53..88ea6697908f 100644
--- a/fs/ecryptfs/mmap.c
+++ b/fs/ecryptfs/mmap.c
@@ -364,18 +364,14 @@ static int fill_zeros_to_end_of_page(struct page *page, unsigned int to)
364{ 364{
365 struct inode *inode = page->mapping->host; 365 struct inode *inode = page->mapping->host;
366 int end_byte_in_page; 366 int end_byte_in_page;
367 char *page_virt;
368 367
369 if ((i_size_read(inode) / PAGE_CACHE_SIZE) != page->index) 368 if ((i_size_read(inode) / PAGE_CACHE_SIZE) != page->index)
370 goto out; 369 goto out;
371 end_byte_in_page = i_size_read(inode) % PAGE_CACHE_SIZE; 370 end_byte_in_page = i_size_read(inode) % PAGE_CACHE_SIZE;
372 if (to > end_byte_in_page) 371 if (to > end_byte_in_page)
373 end_byte_in_page = to; 372 end_byte_in_page = to;
374 page_virt = kmap_atomic(page, KM_USER0); 373 zero_user_page(page, end_byte_in_page,
375 memset((page_virt + end_byte_in_page), 0, 374 PAGE_CACHE_SIZE - end_byte_in_page, KM_USER0);
376 (PAGE_CACHE_SIZE - end_byte_in_page));
377 kunmap_atomic(page_virt, KM_USER0);
378 flush_dcache_page(page);
379out: 375out:
380 return 0; 376 return 0;
381} 377}
@@ -740,7 +736,6 @@ int write_zeros(struct file *file, pgoff_t index, int start, int num_zeros)
740{ 736{
741 int rc = 0; 737 int rc = 0;
742 struct page *tmp_page; 738 struct page *tmp_page;
743 char *tmp_page_virt;
744 739
745 tmp_page = ecryptfs_get1page(file, index); 740 tmp_page = ecryptfs_get1page(file, index);
746 if (IS_ERR(tmp_page)) { 741 if (IS_ERR(tmp_page)) {
@@ -757,10 +752,7 @@ int write_zeros(struct file *file, pgoff_t index, int start, int num_zeros)
757 page_cache_release(tmp_page); 752 page_cache_release(tmp_page);
758 goto out; 753 goto out;
759 } 754 }
760 tmp_page_virt = kmap_atomic(tmp_page, KM_USER0); 755 zero_user_page(tmp_page, start, num_zeros, KM_USER0);
761 memset(((char *)tmp_page_virt + start), 0, num_zeros);
762 kunmap_atomic(tmp_page_virt, KM_USER0);
763 flush_dcache_page(tmp_page);
764 rc = ecryptfs_commit_write(file, tmp_page, start, start + num_zeros); 756 rc = ecryptfs_commit_write(file, tmp_page, start, start + num_zeros);
765 if (rc < 0) { 757 if (rc < 0) {
766 ecryptfs_printk(KERN_ERR, "Error attempting to write zero's " 758 ecryptfs_printk(KERN_ERR, "Error attempting to write zero's "
diff --git a/fs/efs/super.c b/fs/efs/super.c
index ba7a8b9da0c1..e0a6839e68ae 100644
--- a/fs/efs/super.c
+++ b/fs/efs/super.c
@@ -72,8 +72,7 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
72{ 72{
73 struct efs_inode_info *ei = (struct efs_inode_info *) foo; 73 struct efs_inode_info *ei = (struct efs_inode_info *) foo;
74 74
75 if (flags & SLAB_CTOR_CONSTRUCTOR) 75 inode_init_once(&ei->vfs_inode);
76 inode_init_once(&ei->vfs_inode);
77} 76}
78 77
79static int init_inodecache(void) 78static int init_inodecache(void)
diff --git a/fs/exec.c b/fs/exec.c
index 70fa36554c14..0b685888ff6f 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -60,7 +60,7 @@
60#endif 60#endif
61 61
62int core_uses_pid; 62int core_uses_pid;
63char core_pattern[128] = "core"; 63char core_pattern[CORENAME_MAX_SIZE] = "core";
64int suid_dumpable = 0; 64int suid_dumpable = 0;
65 65
66EXPORT_SYMBOL(suid_dumpable); 66EXPORT_SYMBOL(suid_dumpable);
@@ -1264,8 +1264,6 @@ int set_binfmt(struct linux_binfmt *new)
1264 1264
1265EXPORT_SYMBOL(set_binfmt); 1265EXPORT_SYMBOL(set_binfmt);
1266 1266
1267#define CORENAME_MAX_SIZE 64
1268
1269/* format_corename will inspect the pattern parameter, and output a 1267/* format_corename will inspect the pattern parameter, and output a
1270 * name into corename, which must have space for at least 1268 * name into corename, which must have space for at least
1271 * CORENAME_MAX_SIZE bytes plus one byte for the zero terminator. 1269 * CORENAME_MAX_SIZE bytes plus one byte for the zero terminator.
diff --git a/fs/ext2/super.c b/fs/ext2/super.c
index 685a1c287177..16337bff0272 100644
--- a/fs/ext2/super.c
+++ b/fs/ext2/super.c
@@ -160,13 +160,11 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
160{ 160{
161 struct ext2_inode_info *ei = (struct ext2_inode_info *) foo; 161 struct ext2_inode_info *ei = (struct ext2_inode_info *) foo;
162 162
163 if (flags & SLAB_CTOR_CONSTRUCTOR) { 163 rwlock_init(&ei->i_meta_lock);
164 rwlock_init(&ei->i_meta_lock);
165#ifdef CONFIG_EXT2_FS_XATTR 164#ifdef CONFIG_EXT2_FS_XATTR
166 init_rwsem(&ei->xattr_sem); 165 init_rwsem(&ei->xattr_sem);
167#endif 166#endif
168 inode_init_once(&ei->vfs_inode); 167 inode_init_once(&ei->vfs_inode);
169 }
170} 168}
171 169
172static int init_inodecache(void) 170static int init_inodecache(void)
diff --git a/fs/ext3/super.c b/fs/ext3/super.c
index 54d3c9041259..6e3062913a92 100644
--- a/fs/ext3/super.c
+++ b/fs/ext3/super.c
@@ -466,14 +466,12 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
466{ 466{
467 struct ext3_inode_info *ei = (struct ext3_inode_info *) foo; 467 struct ext3_inode_info *ei = (struct ext3_inode_info *) foo;
468 468
469 if (flags & SLAB_CTOR_CONSTRUCTOR) { 469 INIT_LIST_HEAD(&ei->i_orphan);
470 INIT_LIST_HEAD(&ei->i_orphan);
471#ifdef CONFIG_EXT3_FS_XATTR 470#ifdef CONFIG_EXT3_FS_XATTR
472 init_rwsem(&ei->xattr_sem); 471 init_rwsem(&ei->xattr_sem);
473#endif 472#endif
474 mutex_init(&ei->truncate_mutex); 473 mutex_init(&ei->truncate_mutex);
475 inode_init_once(&ei->vfs_inode); 474 inode_init_once(&ei->vfs_inode);
476 }
477} 475}
478 476
479static int init_inodecache(void) 477static int init_inodecache(void)
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 719126932354..cb9afdd0e26e 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -517,14 +517,12 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
517{ 517{
518 struct ext4_inode_info *ei = (struct ext4_inode_info *) foo; 518 struct ext4_inode_info *ei = (struct ext4_inode_info *) foo;
519 519
520 if (flags & SLAB_CTOR_CONSTRUCTOR) { 520 INIT_LIST_HEAD(&ei->i_orphan);
521 INIT_LIST_HEAD(&ei->i_orphan);
522#ifdef CONFIG_EXT4DEV_FS_XATTR 521#ifdef CONFIG_EXT4DEV_FS_XATTR
523 init_rwsem(&ei->xattr_sem); 522 init_rwsem(&ei->xattr_sem);
524#endif 523#endif
525 mutex_init(&ei->truncate_mutex); 524 mutex_init(&ei->truncate_mutex);
526 inode_init_once(&ei->vfs_inode); 525 inode_init_once(&ei->vfs_inode);
527 }
528} 526}
529 527
530static int init_inodecache(void) 528static int init_inodecache(void)
diff --git a/fs/fat/cache.c b/fs/fat/cache.c
index 1959143c1d27..3c9c8a15ec73 100644
--- a/fs/fat/cache.c
+++ b/fs/fat/cache.c
@@ -40,8 +40,7 @@ static void init_once(void *foo, struct kmem_cache *cachep, unsigned long flags)
40{ 40{
41 struct fat_cache *cache = (struct fat_cache *)foo; 41 struct fat_cache *cache = (struct fat_cache *)foo;
42 42
43 if (flags & SLAB_CTOR_CONSTRUCTOR) 43 INIT_LIST_HEAD(&cache->cache_list);
44 INIT_LIST_HEAD(&cache->cache_list);
45} 44}
46 45
47int __init fat_cache_init(void) 46int __init fat_cache_init(void)
diff --git a/fs/fat/inode.c b/fs/fat/inode.c
index 2c55e8dce793..479722d89667 100644
--- a/fs/fat/inode.c
+++ b/fs/fat/inode.c
@@ -500,14 +500,12 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
500{ 500{
501 struct msdos_inode_info *ei = (struct msdos_inode_info *)foo; 501 struct msdos_inode_info *ei = (struct msdos_inode_info *)foo;
502 502
503 if (flags & SLAB_CTOR_CONSTRUCTOR) { 503 spin_lock_init(&ei->cache_lru_lock);
504 spin_lock_init(&ei->cache_lru_lock); 504 ei->nr_caches = 0;
505 ei->nr_caches = 0; 505 ei->cache_valid_id = FAT_CACHE_VALID + 1;
506 ei->cache_valid_id = FAT_CACHE_VALID + 1; 506 INIT_LIST_HEAD(&ei->cache_lru);
507 INIT_LIST_HEAD(&ei->cache_lru); 507 INIT_HLIST_NODE(&ei->i_fat_hash);
508 INIT_HLIST_NODE(&ei->i_fat_hash); 508 inode_init_once(&ei->vfs_inode);
509 inode_init_once(&ei->vfs_inode);
510 }
511} 509}
512 510
513static int __init fat_init_inodecache(void) 511static int __init fat_init_inodecache(void)
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
index 1397018ff476..c3a2ad0da43c 100644
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -687,8 +687,7 @@ static void fuse_inode_init_once(void *foo, struct kmem_cache *cachep,
687{ 687{
688 struct inode * inode = foo; 688 struct inode * inode = foo;
689 689
690 if (flags & SLAB_CTOR_CONSTRUCTOR) 690 inode_init_once(inode);
691 inode_init_once(inode);
692} 691}
693 692
694static int __init fuse_fs_init(void) 693static int __init fuse_fs_init(void)
diff --git a/fs/gfs2/main.c b/fs/gfs2/main.c
index e460487c0557..787a0edef100 100644
--- a/fs/gfs2/main.c
+++ b/fs/gfs2/main.c
@@ -27,29 +27,27 @@
27static void gfs2_init_inode_once(void *foo, struct kmem_cache *cachep, unsigned long flags) 27static void gfs2_init_inode_once(void *foo, struct kmem_cache *cachep, unsigned long flags)
28{ 28{
29 struct gfs2_inode *ip = foo; 29 struct gfs2_inode *ip = foo;
30 if (flags & SLAB_CTOR_CONSTRUCTOR) { 30
31 inode_init_once(&ip->i_inode); 31 inode_init_once(&ip->i_inode);
32 spin_lock_init(&ip->i_spin); 32 spin_lock_init(&ip->i_spin);
33 init_rwsem(&ip->i_rw_mutex); 33 init_rwsem(&ip->i_rw_mutex);
34 memset(ip->i_cache, 0, sizeof(ip->i_cache)); 34 memset(ip->i_cache, 0, sizeof(ip->i_cache));
35 }
36} 35}
37 36
38static void gfs2_init_glock_once(void *foo, struct kmem_cache *cachep, unsigned long flags) 37static void gfs2_init_glock_once(void *foo, struct kmem_cache *cachep, unsigned long flags)
39{ 38{
40 struct gfs2_glock *gl = foo; 39 struct gfs2_glock *gl = foo;
41 if (flags & SLAB_CTOR_CONSTRUCTOR) { 40
42 INIT_HLIST_NODE(&gl->gl_list); 41 INIT_HLIST_NODE(&gl->gl_list);
43 spin_lock_init(&gl->gl_spin); 42 spin_lock_init(&gl->gl_spin);
44 INIT_LIST_HEAD(&gl->gl_holders); 43 INIT_LIST_HEAD(&gl->gl_holders);
45 INIT_LIST_HEAD(&gl->gl_waiters1); 44 INIT_LIST_HEAD(&gl->gl_waiters1);
46 INIT_LIST_HEAD(&gl->gl_waiters3); 45 INIT_LIST_HEAD(&gl->gl_waiters3);
47 gl->gl_lvb = NULL; 46 gl->gl_lvb = NULL;
48 atomic_set(&gl->gl_lvb_count, 0); 47 atomic_set(&gl->gl_lvb_count, 0);
49 INIT_LIST_HEAD(&gl->gl_reclaim); 48 INIT_LIST_HEAD(&gl->gl_reclaim);
50 INIT_LIST_HEAD(&gl->gl_ail_list); 49 INIT_LIST_HEAD(&gl->gl_ail_list);
51 atomic_set(&gl->gl_ail_count, 0); 50 atomic_set(&gl->gl_ail_count, 0);
52 }
53} 51}
54 52
55/** 53/**
diff --git a/fs/hfs/super.c b/fs/hfs/super.c
index 4f1888f16cf0..92cf8751e428 100644
--- a/fs/hfs/super.c
+++ b/fs/hfs/super.c
@@ -434,8 +434,7 @@ static void hfs_init_once(void *p, struct kmem_cache *cachep, unsigned long flag
434{ 434{
435 struct hfs_inode_info *i = p; 435 struct hfs_inode_info *i = p;
436 436
437 if (flags & SLAB_CTOR_CONSTRUCTOR) 437 inode_init_once(&i->vfs_inode);
438 inode_init_once(&i->vfs_inode);
439} 438}
440 439
441static int __init init_hfs_fs(void) 440static int __init init_hfs_fs(void)
diff --git a/fs/hfsplus/super.c b/fs/hfsplus/super.c
index 37afbec8a761..ebd1b380cbbc 100644
--- a/fs/hfsplus/super.c
+++ b/fs/hfsplus/super.c
@@ -470,8 +470,7 @@ static void hfsplus_init_once(void *p, struct kmem_cache *cachep, unsigned long
470{ 470{
471 struct hfsplus_inode_info *i = p; 471 struct hfsplus_inode_info *i = p;
472 472
473 if (flags & SLAB_CTOR_CONSTRUCTOR) 473 inode_init_once(&i->vfs_inode);
474 inode_init_once(&i->vfs_inode);
475} 474}
476 475
477static int __init init_hfsplus_fs(void) 476static int __init init_hfsplus_fs(void)
diff --git a/fs/hpfs/super.c b/fs/hpfs/super.c
index 1b95f39fbc37..fca1165d7192 100644
--- a/fs/hpfs/super.c
+++ b/fs/hpfs/super.c
@@ -176,11 +176,9 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
176{ 176{
177 struct hpfs_inode_info *ei = (struct hpfs_inode_info *) foo; 177 struct hpfs_inode_info *ei = (struct hpfs_inode_info *) foo;
178 178
179 if (flags & SLAB_CTOR_CONSTRUCTOR) { 179 mutex_init(&ei->i_mutex);
180 mutex_init(&ei->i_mutex); 180 mutex_init(&ei->i_parent_mutex);
181 mutex_init(&ei->i_parent_mutex); 181 inode_init_once(&ei->vfs_inode);
182 inode_init_once(&ei->vfs_inode);
183 }
184} 182}
185 183
186static int init_inodecache(void) 184static int init_inodecache(void)
diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
index 98959b87cdf8..aa083dd34e92 100644
--- a/fs/hugetlbfs/inode.c
+++ b/fs/hugetlbfs/inode.c
@@ -556,8 +556,7 @@ static void init_once(void *foo, struct kmem_cache *cachep, unsigned long flags)
556{ 556{
557 struct hugetlbfs_inode_info *ei = (struct hugetlbfs_inode_info *)foo; 557 struct hugetlbfs_inode_info *ei = (struct hugetlbfs_inode_info *)foo;
558 558
559 if (flags & SLAB_CTOR_CONSTRUCTOR) 559 inode_init_once(&ei->vfs_inode);
560 inode_init_once(&ei->vfs_inode);
561} 560}
562 561
563const struct file_operations hugetlbfs_file_operations = { 562const struct file_operations hugetlbfs_file_operations = {
diff --git a/fs/inode.c b/fs/inode.c
index df2ef15d03d2..9a012cc5b6cd 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -213,8 +213,7 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
213{ 213{
214 struct inode * inode = (struct inode *) foo; 214 struct inode * inode = (struct inode *) foo;
215 215
216 if (flags & SLAB_CTOR_CONSTRUCTOR) 216 inode_init_once(inode);
217 inode_init_once(inode);
218} 217}
219 218
220/* 219/*
diff --git a/fs/isofs/inode.c b/fs/isofs/inode.c
index e99f7ff4ecb4..5c3eecf7542e 100644
--- a/fs/isofs/inode.c
+++ b/fs/isofs/inode.c
@@ -77,8 +77,7 @@ static void init_once(void *foo, struct kmem_cache * cachep, unsigned long flags
77{ 77{
78 struct iso_inode_info *ei = foo; 78 struct iso_inode_info *ei = foo;
79 79
80 if (flags & SLAB_CTOR_CONSTRUCTOR) 80 inode_init_once(&ei->vfs_inode);
81 inode_init_once(&ei->vfs_inode);
82} 81}
83 82
84static int init_inodecache(void) 83static int init_inodecache(void)
diff --git a/fs/jffs2/super.c b/fs/jffs2/super.c
index 45368f8bbe72..6488af43bc9b 100644
--- a/fs/jffs2/super.c
+++ b/fs/jffs2/super.c
@@ -47,10 +47,8 @@ static void jffs2_i_init_once(void * foo, struct kmem_cache * cachep, unsigned l
47{ 47{
48 struct jffs2_inode_info *ei = (struct jffs2_inode_info *) foo; 48 struct jffs2_inode_info *ei = (struct jffs2_inode_info *) foo;
49 49
50 if (flags & SLAB_CTOR_CONSTRUCTOR) { 50 init_MUTEX(&ei->sem);
51 init_MUTEX(&ei->sem); 51 inode_init_once(&ei->vfs_inode);
52 inode_init_once(&ei->vfs_inode);
53 }
54} 52}
55 53
56static int jffs2_sync_fs(struct super_block *sb, int wait) 54static int jffs2_sync_fs(struct super_block *sb, int wait)
diff --git a/fs/jfs/jfs_metapage.c b/fs/jfs/jfs_metapage.c
index 6b3acb0b5781..43d4f69afbec 100644
--- a/fs/jfs/jfs_metapage.c
+++ b/fs/jfs/jfs_metapage.c
@@ -184,16 +184,14 @@ static void init_once(void *foo, struct kmem_cache *cachep, unsigned long flags)
184{ 184{
185 struct metapage *mp = (struct metapage *)foo; 185 struct metapage *mp = (struct metapage *)foo;
186 186
187 if (flags & SLAB_CTOR_CONSTRUCTOR) { 187 mp->lid = 0;
188 mp->lid = 0; 188 mp->lsn = 0;
189 mp->lsn = 0; 189 mp->flag = 0;
190 mp->flag = 0; 190 mp->data = NULL;
191 mp->data = NULL; 191 mp->clsn = 0;
192 mp->clsn = 0; 192 mp->log = NULL;
193 mp->log = NULL; 193 set_bit(META_free, &mp->flag);
194 set_bit(META_free, &mp->flag); 194 init_waitqueue_head(&mp->wait);
195 init_waitqueue_head(&mp->wait);
196 }
197} 195}
198 196
199static inline struct metapage *alloc_metapage(gfp_t gfp_mask) 197static inline struct metapage *alloc_metapage(gfp_t gfp_mask)
diff --git a/fs/jfs/super.c b/fs/jfs/super.c
index ea9dc3e65dcf..20e4ac1c79a3 100644
--- a/fs/jfs/super.c
+++ b/fs/jfs/super.c
@@ -752,20 +752,18 @@ static void init_once(void *foo, struct kmem_cache * cachep, unsigned long flags
752{ 752{
753 struct jfs_inode_info *jfs_ip = (struct jfs_inode_info *) foo; 753 struct jfs_inode_info *jfs_ip = (struct jfs_inode_info *) foo;
754 754
755 if (flags & SLAB_CTOR_CONSTRUCTOR) { 755 memset(jfs_ip, 0, sizeof(struct jfs_inode_info));
756 memset(jfs_ip, 0, sizeof(struct jfs_inode_info)); 756 INIT_LIST_HEAD(&jfs_ip->anon_inode_list);
757 INIT_LIST_HEAD(&jfs_ip->anon_inode_list); 757 init_rwsem(&jfs_ip->rdwrlock);
758 init_rwsem(&jfs_ip->rdwrlock); 758 mutex_init(&jfs_ip->commit_mutex);
759 mutex_init(&jfs_ip->commit_mutex); 759 init_rwsem(&jfs_ip->xattr_sem);
760 init_rwsem(&jfs_ip->xattr_sem); 760 spin_lock_init(&jfs_ip->ag_lock);
761 spin_lock_init(&jfs_ip->ag_lock); 761 jfs_ip->active_ag = -1;
762 jfs_ip->active_ag = -1;
763#ifdef CONFIG_JFS_POSIX_ACL 762#ifdef CONFIG_JFS_POSIX_ACL
764 jfs_ip->i_acl = JFS_ACL_NOT_CACHED; 763 jfs_ip->i_acl = JFS_ACL_NOT_CACHED;
765 jfs_ip->i_default_acl = JFS_ACL_NOT_CACHED; 764 jfs_ip->i_default_acl = JFS_ACL_NOT_CACHED;
766#endif 765#endif
767 inode_init_once(&jfs_ip->vfs_inode); 766 inode_init_once(&jfs_ip->vfs_inode);
768 }
769} 767}
770 768
771static int __init init_jfs_fs(void) 769static int __init init_jfs_fs(void)
diff --git a/fs/locks.c b/fs/locks.c
index 8ec16ab5ef74..431a8b871fce 100644
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -203,9 +203,6 @@ static void init_once(void *foo, struct kmem_cache *cache, unsigned long flags)
203{ 203{
204 struct file_lock *lock = (struct file_lock *) foo; 204 struct file_lock *lock = (struct file_lock *) foo;
205 205
206 if (!(flags & SLAB_CTOR_CONSTRUCTOR))
207 return;
208
209 locks_init_lock(lock); 206 locks_init_lock(lock);
210} 207}
211 208
diff --git a/fs/minix/inode.c b/fs/minix/inode.c
index 2f4d43a2a310..be4044614ac8 100644
--- a/fs/minix/inode.c
+++ b/fs/minix/inode.c
@@ -73,8 +73,7 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
73{ 73{
74 struct minix_inode_info *ei = (struct minix_inode_info *) foo; 74 struct minix_inode_info *ei = (struct minix_inode_info *) foo;
75 75
76 if (flags & SLAB_CTOR_CONSTRUCTOR) 76 inode_init_once(&ei->vfs_inode);
77 inode_init_once(&ei->vfs_inode);
78} 77}
79 78
80static int init_inodecache(void) 79static int init_inodecache(void)
diff --git a/fs/ncpfs/inode.c b/fs/ncpfs/inode.c
index c29f00ad495d..cf06eb9f050e 100644
--- a/fs/ncpfs/inode.c
+++ b/fs/ncpfs/inode.c
@@ -60,10 +60,8 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
60{ 60{
61 struct ncp_inode_info *ei = (struct ncp_inode_info *) foo; 61 struct ncp_inode_info *ei = (struct ncp_inode_info *) foo;
62 62
63 if (flags & SLAB_CTOR_CONSTRUCTOR) { 63 mutex_init(&ei->open_mutex);
64 mutex_init(&ei->open_mutex); 64 inode_init_once(&ei->vfs_inode);
65 inode_init_once(&ei->vfs_inode);
66 }
67} 65}
68 66
69static int init_inodecache(void) 67static int init_inodecache(void)
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index 2a3fd9573207..2b26ad7c9770 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -1164,21 +1164,19 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
1164{ 1164{
1165 struct nfs_inode *nfsi = (struct nfs_inode *) foo; 1165 struct nfs_inode *nfsi = (struct nfs_inode *) foo;
1166 1166
1167 if (flags & SLAB_CTOR_CONSTRUCTOR) { 1167 inode_init_once(&nfsi->vfs_inode);
1168 inode_init_once(&nfsi->vfs_inode); 1168 spin_lock_init(&nfsi->req_lock);
1169 spin_lock_init(&nfsi->req_lock); 1169 INIT_LIST_HEAD(&nfsi->dirty);
1170 INIT_LIST_HEAD(&nfsi->dirty); 1170 INIT_LIST_HEAD(&nfsi->commit);
1171 INIT_LIST_HEAD(&nfsi->commit); 1171 INIT_LIST_HEAD(&nfsi->open_files);
1172 INIT_LIST_HEAD(&nfsi->open_files); 1172 INIT_LIST_HEAD(&nfsi->access_cache_entry_lru);
1173 INIT_LIST_HEAD(&nfsi->access_cache_entry_lru); 1173 INIT_LIST_HEAD(&nfsi->access_cache_inode_lru);
1174 INIT_LIST_HEAD(&nfsi->access_cache_inode_lru); 1174 INIT_RADIX_TREE(&nfsi->nfs_page_tree, GFP_ATOMIC);
1175 INIT_RADIX_TREE(&nfsi->nfs_page_tree, GFP_ATOMIC); 1175 atomic_set(&nfsi->data_updates, 0);
1176 atomic_set(&nfsi->data_updates, 0); 1176 nfsi->ndirty = 0;
1177 nfsi->ndirty = 0; 1177 nfsi->ncommit = 0;
1178 nfsi->ncommit = 0; 1178 nfsi->npages = 0;
1179 nfsi->npages = 0; 1179 nfs4_init_once(nfsi);
1180 nfs4_init_once(nfsi);
1181 }
1182} 1180}
1183 1181
1184static int __init nfs_init_inodecache(void) 1182static int __init nfs_init_inodecache(void)
diff --git a/fs/ntfs/super.c b/fs/ntfs/super.c
index 21d834e5ed73..4566b9182551 100644
--- a/fs/ntfs/super.c
+++ b/fs/ntfs/super.c
@@ -3085,8 +3085,7 @@ static void ntfs_big_inode_init_once(void *foo, struct kmem_cache *cachep,
3085{ 3085{
3086 ntfs_inode *ni = (ntfs_inode *)foo; 3086 ntfs_inode *ni = (ntfs_inode *)foo;
3087 3087
3088 if (flags & SLAB_CTOR_CONSTRUCTOR) 3088 inode_init_once(VFS_I(ni));
3089 inode_init_once(VFS_I(ni));
3090} 3089}
3091 3090
3092/* 3091/*
diff --git a/fs/ocfs2/dlm/dlmfs.c b/fs/ocfs2/dlm/dlmfs.c
index 5671cf9d6383..fd8cb1badc9b 100644
--- a/fs/ocfs2/dlm/dlmfs.c
+++ b/fs/ocfs2/dlm/dlmfs.c
@@ -262,12 +262,10 @@ static void dlmfs_init_once(void *foo,
262 struct dlmfs_inode_private *ip = 262 struct dlmfs_inode_private *ip =
263 (struct dlmfs_inode_private *) foo; 263 (struct dlmfs_inode_private *) foo;
264 264
265 if (flags & SLAB_CTOR_CONSTRUCTOR) { 265 ip->ip_dlm = NULL;
266 ip->ip_dlm = NULL; 266 ip->ip_parent = NULL;
267 ip->ip_parent = NULL;
268 267
269 inode_init_once(&ip->ip_vfs_inode); 268 inode_init_once(&ip->ip_vfs_inode);
270 }
271} 269}
272 270
273static struct inode *dlmfs_alloc_inode(struct super_block *sb) 271static struct inode *dlmfs_alloc_inode(struct super_block *sb)
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
index 7c5e3f5d6634..86b559c7dce9 100644
--- a/fs/ocfs2/super.c
+++ b/fs/ocfs2/super.c
@@ -937,31 +937,29 @@ static void ocfs2_inode_init_once(void *data,
937{ 937{
938 struct ocfs2_inode_info *oi = data; 938 struct ocfs2_inode_info *oi = data;
939 939
940 if (flags & SLAB_CTOR_CONSTRUCTOR) { 940 oi->ip_flags = 0;
941 oi->ip_flags = 0; 941 oi->ip_open_count = 0;
942 oi->ip_open_count = 0; 942 spin_lock_init(&oi->ip_lock);
943 spin_lock_init(&oi->ip_lock); 943 ocfs2_extent_map_init(&oi->vfs_inode);
944 ocfs2_extent_map_init(&oi->vfs_inode); 944 INIT_LIST_HEAD(&oi->ip_io_markers);
945 INIT_LIST_HEAD(&oi->ip_io_markers); 945 oi->ip_created_trans = 0;
946 oi->ip_created_trans = 0; 946 oi->ip_last_trans = 0;
947 oi->ip_last_trans = 0; 947 oi->ip_dir_start_lookup = 0;
948 oi->ip_dir_start_lookup = 0;
949 948
950 init_rwsem(&oi->ip_alloc_sem); 949 init_rwsem(&oi->ip_alloc_sem);
951 mutex_init(&oi->ip_io_mutex); 950 mutex_init(&oi->ip_io_mutex);
952 951
953 oi->ip_blkno = 0ULL; 952 oi->ip_blkno = 0ULL;
954 oi->ip_clusters = 0; 953 oi->ip_clusters = 0;
955 954
956 ocfs2_lock_res_init_once(&oi->ip_rw_lockres); 955 ocfs2_lock_res_init_once(&oi->ip_rw_lockres);
957 ocfs2_lock_res_init_once(&oi->ip_meta_lockres); 956 ocfs2_lock_res_init_once(&oi->ip_meta_lockres);
958 ocfs2_lock_res_init_once(&oi->ip_data_lockres); 957 ocfs2_lock_res_init_once(&oi->ip_data_lockres);
959 ocfs2_lock_res_init_once(&oi->ip_open_lockres); 958 ocfs2_lock_res_init_once(&oi->ip_open_lockres);
960 959
961 ocfs2_metadata_cache_init(&oi->vfs_inode); 960 ocfs2_metadata_cache_init(&oi->vfs_inode);
962 961
963 inode_init_once(&oi->vfs_inode); 962 inode_init_once(&oi->vfs_inode);
964 }
965} 963}
966 964
967static int ocfs2_initialize_mem_caches(void) 965static int ocfs2_initialize_mem_caches(void)
diff --git a/fs/openpromfs/inode.c b/fs/openpromfs/inode.c
index 731a90e9f0cd..e62397341c36 100644
--- a/fs/openpromfs/inode.c
+++ b/fs/openpromfs/inode.c
@@ -419,8 +419,7 @@ static void op_inode_init_once(void *data, struct kmem_cache * cachep, unsigned
419{ 419{
420 struct op_inode_info *oi = (struct op_inode_info *) data; 420 struct op_inode_info *oi = (struct op_inode_info *) data;
421 421
422 if (flags & SLAB_CTOR_CONSTRUCTOR) 422 inode_init_once(&oi->vfs_inode);
423 inode_init_once(&oi->vfs_inode);
424} 423}
425 424
426static int __init init_openprom_fs(void) 425static int __init init_openprom_fs(void)
diff --git a/fs/proc/inode.c b/fs/proc/inode.c
index b8171907c83b..d5ce65c68d7b 100644
--- a/fs/proc/inode.c
+++ b/fs/proc/inode.c
@@ -109,8 +109,7 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
109{ 109{
110 struct proc_inode *ei = (struct proc_inode *) foo; 110 struct proc_inode *ei = (struct proc_inode *) foo;
111 111
112 if (flags & SLAB_CTOR_CONSTRUCTOR) 112 inode_init_once(&ei->vfs_inode);
113 inode_init_once(&ei->vfs_inode);
114} 113}
115 114
116int __init proc_init_inodecache(void) 115int __init proc_init_inodecache(void)
diff --git a/fs/qnx4/inode.c b/fs/qnx4/inode.c
index 75fc8498f2e2..8d256eb11813 100644
--- a/fs/qnx4/inode.c
+++ b/fs/qnx4/inode.c
@@ -536,8 +536,7 @@ static void init_once(void *foo, struct kmem_cache * cachep,
536{ 536{
537 struct qnx4_inode_info *ei = (struct qnx4_inode_info *) foo; 537 struct qnx4_inode_info *ei = (struct qnx4_inode_info *) foo;
538 538
539 if (flags & SLAB_CTOR_CONSTRUCTOR) 539 inode_init_once(&ei->vfs_inode);
540 inode_init_once(&ei->vfs_inode);
541} 540}
542 541
543static int init_inodecache(void) 542static int init_inodecache(void)
diff --git a/fs/quota.c b/fs/quota.c
index e9d88fd0eca8..9f237d6182c9 100644
--- a/fs/quota.c
+++ b/fs/quota.c
@@ -157,7 +157,6 @@ static int check_quotactl_valid(struct super_block *sb, int type, int cmd, qid_t
157static void quota_sync_sb(struct super_block *sb, int type) 157static void quota_sync_sb(struct super_block *sb, int type)
158{ 158{
159 int cnt; 159 int cnt;
160 struct inode *discard[MAXQUOTAS];
161 160
162 sb->s_qcop->quota_sync(sb, type); 161 sb->s_qcop->quota_sync(sb, type);
163 /* This is not very clever (and fast) but currently I don't know about 162 /* This is not very clever (and fast) but currently I don't know about
@@ -167,29 +166,21 @@ static void quota_sync_sb(struct super_block *sb, int type)
167 sb->s_op->sync_fs(sb, 1); 166 sb->s_op->sync_fs(sb, 1);
168 sync_blockdev(sb->s_bdev); 167 sync_blockdev(sb->s_bdev);
169 168
170 /* Now when everything is written we can discard the pagecache so 169 /*
171 * that userspace sees the changes. We need i_mutex and so we could 170 * Now when everything is written we can discard the pagecache so
172 * not do it inside dqonoff_mutex. Moreover we need to be carefull 171 * that userspace sees the changes.
173 * about races with quotaoff() (that is the reason why we have own 172 */
174 * reference to inode). */
175 mutex_lock(&sb_dqopt(sb)->dqonoff_mutex); 173 mutex_lock(&sb_dqopt(sb)->dqonoff_mutex);
176 for (cnt = 0; cnt < MAXQUOTAS; cnt++) { 174 for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
177 discard[cnt] = NULL;
178 if (type != -1 && cnt != type) 175 if (type != -1 && cnt != type)
179 continue; 176 continue;
180 if (!sb_has_quota_enabled(sb, cnt)) 177 if (!sb_has_quota_enabled(sb, cnt))
181 continue; 178 continue;
182 discard[cnt] = igrab(sb_dqopt(sb)->files[cnt]); 179 mutex_lock_nested(&sb_dqopt(sb)->files[cnt]->i_mutex, I_MUTEX_QUOTA);
180 truncate_inode_pages(&sb_dqopt(sb)->files[cnt]->i_data, 0);
181 mutex_unlock(&sb_dqopt(sb)->files[cnt]->i_mutex);
183 } 182 }
184 mutex_unlock(&sb_dqopt(sb)->dqonoff_mutex); 183 mutex_unlock(&sb_dqopt(sb)->dqonoff_mutex);
185 for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
186 if (discard[cnt]) {
187 mutex_lock(&discard[cnt]->i_mutex);
188 truncate_inode_pages(&discard[cnt]->i_data, 0);
189 mutex_unlock(&discard[cnt]->i_mutex);
190 iput(discard[cnt]);
191 }
192 }
193} 184}
194 185
195void sync_dquots(struct super_block *sb, int type) 186void sync_dquots(struct super_block *sb, int type)
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c
index c7762140c425..b4ac9119200e 100644
--- a/fs/reiserfs/super.c
+++ b/fs/reiserfs/super.c
@@ -511,14 +511,12 @@ static void init_once(void *foo, struct kmem_cache * cachep, unsigned long flags
511{ 511{
512 struct reiserfs_inode_info *ei = (struct reiserfs_inode_info *)foo; 512 struct reiserfs_inode_info *ei = (struct reiserfs_inode_info *)foo;
513 513
514 if (flags & SLAB_CTOR_CONSTRUCTOR) { 514 INIT_LIST_HEAD(&ei->i_prealloc_list);
515 INIT_LIST_HEAD(&ei->i_prealloc_list); 515 inode_init_once(&ei->vfs_inode);
516 inode_init_once(&ei->vfs_inode);
517#ifdef CONFIG_REISERFS_FS_POSIX_ACL 516#ifdef CONFIG_REISERFS_FS_POSIX_ACL
518 ei->i_acl_access = NULL; 517 ei->i_acl_access = NULL;
519 ei->i_acl_default = NULL; 518 ei->i_acl_default = NULL;
520#endif 519#endif
521 }
522} 520}
523 521
524static int init_inodecache(void) 522static int init_inodecache(void)
diff --git a/fs/romfs/inode.c b/fs/romfs/inode.c
index 804285190271..2284e03342c6 100644
--- a/fs/romfs/inode.c
+++ b/fs/romfs/inode.c
@@ -566,12 +566,11 @@ static void romfs_destroy_inode(struct inode *inode)
566 kmem_cache_free(romfs_inode_cachep, ROMFS_I(inode)); 566 kmem_cache_free(romfs_inode_cachep, ROMFS_I(inode));
567} 567}
568 568
569static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flags) 569static void init_once(void *foo, struct kmem_cache *cachep, unsigned long flags)
570{ 570{
571 struct romfs_inode_info *ei = (struct romfs_inode_info *) foo; 571 struct romfs_inode_info *ei = foo;
572 572
573 if (flags & SLAB_CTOR_CONSTRUCTOR) 573 inode_init_once(&ei->vfs_inode);
574 inode_init_once(&ei->vfs_inode);
575} 574}
576 575
577static int init_inodecache(void) 576static int init_inodecache(void)
diff --git a/fs/smbfs/inode.c b/fs/smbfs/inode.c
index 424a3ddf86dd..5c9243a23b9b 100644
--- a/fs/smbfs/inode.c
+++ b/fs/smbfs/inode.c
@@ -70,8 +70,7 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
70{ 70{
71 struct smb_inode_info *ei = (struct smb_inode_info *) foo; 71 struct smb_inode_info *ei = (struct smb_inode_info *) foo;
72 72
73 if (flags & SLAB_CTOR_CONSTRUCTOR) 73 inode_init_once(&ei->vfs_inode);
74 inode_init_once(&ei->vfs_inode);
75} 74}
76 75
77static int init_inodecache(void) 76static int init_inodecache(void)
diff --git a/fs/sysv/inode.c b/fs/sysv/inode.c
index 3152d7415606..564411693394 100644
--- a/fs/sysv/inode.c
+++ b/fs/sysv/inode.c
@@ -322,8 +322,7 @@ static void init_once(void *p, struct kmem_cache *cachep, unsigned long flags)
322{ 322{
323 struct sysv_inode_info *si = (struct sysv_inode_info *)p; 323 struct sysv_inode_info *si = (struct sysv_inode_info *)p;
324 324
325 if (flags & SLAB_CTOR_CONSTRUCTOR) 325 inode_init_once(&si->vfs_inode);
326 inode_init_once(&si->vfs_inode);
327} 326}
328 327
329const struct super_operations sysv_sops = { 328const struct super_operations sysv_sops = {
diff --git a/fs/udf/super.c b/fs/udf/super.c
index 9b8644a06e53..3a743d854c17 100644
--- a/fs/udf/super.c
+++ b/fs/udf/super.c
@@ -134,10 +134,8 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
134{ 134{
135 struct udf_inode_info *ei = (struct udf_inode_info *) foo; 135 struct udf_inode_info *ei = (struct udf_inode_info *) foo;
136 136
137 if (flags & SLAB_CTOR_CONSTRUCTOR) { 137 ei->i_ext.i_data = NULL;
138 ei->i_ext.i_data = NULL; 138 inode_init_once(&ei->vfs_inode);
139 inode_init_once(&ei->vfs_inode);
140 }
141} 139}
142 140
143static int init_inodecache(void) 141static int init_inodecache(void)
diff --git a/fs/ufs/super.c b/fs/ufs/super.c
index be7c48c5f203..22ff6ed55ce9 100644
--- a/fs/ufs/super.c
+++ b/fs/ufs/super.c
@@ -1237,8 +1237,7 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
1237{ 1237{
1238 struct ufs_inode_info *ei = (struct ufs_inode_info *) foo; 1238 struct ufs_inode_info *ei = (struct ufs_inode_info *) foo;
1239 1239
1240 if (flags & SLAB_CTOR_CONSTRUCTOR) 1240 inode_init_once(&ei->vfs_inode);
1241 inode_init_once(&ei->vfs_inode);
1242} 1241}
1243 1242
1244static int init_inodecache(void) 1243static int init_inodecache(void)
diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c
index 14e2cbe5a8d5..bf9a9d5909be 100644
--- a/fs/xfs/linux-2.6/xfs_super.c
+++ b/fs/xfs/linux-2.6/xfs_super.c
@@ -360,8 +360,7 @@ xfs_fs_inode_init_once(
360 kmem_zone_t *zonep, 360 kmem_zone_t *zonep,
361 unsigned long flags) 361 unsigned long flags)
362{ 362{
363 if (flags & SLAB_CTOR_CONSTRUCTOR) 363 inode_init_once(vn_to_inode((bhv_vnode_t *)vnode));
364 inode_init_once(vn_to_inode((bhv_vnode_t *)vnode));
365} 364}
366 365
367STATIC int 366STATIC int