aboutsummaryrefslogtreecommitdiffstats
path: root/fs/super.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/super.c')
-rw-r--r--fs/super.c20
1 files changed, 3 insertions, 17 deletions
diff --git a/fs/super.c b/fs/super.c
index 6689dded3c84..c177b92419c5 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -72,7 +72,7 @@ static struct super_block *alloc_super(void)
72 INIT_HLIST_HEAD(&s->s_anon); 72 INIT_HLIST_HEAD(&s->s_anon);
73 INIT_LIST_HEAD(&s->s_inodes); 73 INIT_LIST_HEAD(&s->s_inodes);
74 init_rwsem(&s->s_umount); 74 init_rwsem(&s->s_umount);
75 sema_init(&s->s_lock, 1); 75 mutex_init(&s->s_lock);
76 down_write(&s->s_umount); 76 down_write(&s->s_umount);
77 s->s_count = S_BIAS; 77 s->s_count = S_BIAS;
78 atomic_set(&s->s_active, 1); 78 atomic_set(&s->s_active, 1);
@@ -665,16 +665,6 @@ static int test_bdev_super(struct super_block *s, void *data)
665 return (void *)s->s_bdev == data; 665 return (void *)s->s_bdev == data;
666} 666}
667 667
668static void bdev_uevent(struct block_device *bdev, enum kobject_action action)
669{
670 if (bdev->bd_disk) {
671 if (bdev->bd_part)
672 kobject_uevent(&bdev->bd_part->kobj, action, NULL);
673 else
674 kobject_uevent(&bdev->bd_disk->kobj, action, NULL);
675 }
676}
677
678struct super_block *get_sb_bdev(struct file_system_type *fs_type, 668struct super_block *get_sb_bdev(struct file_system_type *fs_type,
679 int flags, const char *dev_name, void *data, 669 int flags, const char *dev_name, void *data,
680 int (*fill_super)(struct super_block *, void *, int)) 670 int (*fill_super)(struct super_block *, void *, int))
@@ -710,17 +700,14 @@ struct super_block *get_sb_bdev(struct file_system_type *fs_type,
710 700
711 s->s_flags = flags; 701 s->s_flags = flags;
712 strlcpy(s->s_id, bdevname(bdev, b), sizeof(s->s_id)); 702 strlcpy(s->s_id, bdevname(bdev, b), sizeof(s->s_id));
713 s->s_old_blocksize = block_size(bdev); 703 sb_set_blocksize(s, block_size(bdev));
714 sb_set_blocksize(s, s->s_old_blocksize);
715 error = fill_super(s, data, flags & MS_VERBOSE ? 1 : 0); 704 error = fill_super(s, data, flags & MS_VERBOSE ? 1 : 0);
716 if (error) { 705 if (error) {
717 up_write(&s->s_umount); 706 up_write(&s->s_umount);
718 deactivate_super(s); 707 deactivate_super(s);
719 s = ERR_PTR(error); 708 s = ERR_PTR(error);
720 } else { 709 } else
721 s->s_flags |= MS_ACTIVE; 710 s->s_flags |= MS_ACTIVE;
722 bdev_uevent(bdev, KOBJ_MOUNT);
723 }
724 } 711 }
725 712
726 return s; 713 return s;
@@ -736,7 +723,6 @@ void kill_block_super(struct super_block *sb)
736{ 723{
737 struct block_device *bdev = sb->s_bdev; 724 struct block_device *bdev = sb->s_bdev;
738 725
739 bdev_uevent(bdev, KOBJ_UMOUNT);
740 generic_shutdown_super(sb); 726 generic_shutdown_super(sb);
741 sync_blockdev(bdev); 727 sync_blockdev(bdev);
742 close_bdev_excl(bdev); 728 close_bdev_excl(bdev);