aboutsummaryrefslogtreecommitdiffstats
path: root/fs/block_dev.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/block_dev.c')
-rw-r--r--fs/block_dev.c16
1 files changed, 7 insertions, 9 deletions
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)