bd_mount_sem is used as mutex so make it a mutex. Signed-off-by: Thomas Gleixner Cc: Al Viro --- fs/block_dev.c | 8 ++++---- fs/super.c | 4 ++-- include/linux/fs.h | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) Index: linux-2.6-tip/fs/block_dev.c =================================================================== --- linux-2.6-tip.orig/fs/block_dev.c +++ linux-2.6-tip/fs/block_dev.c @@ -240,7 +240,7 @@ struct super_block *freeze_bdev(struct b } bdev->bd_fsfreeze_count++; - down(&bdev->bd_mount_sem); + mutex_lock(&bdev->bd_mount_sem); sb = get_super(bdev); if (sb && !(sb->s_flags & MS_RDONLY)) { sb->s_frozen = SB_FREEZE_WRITE; @@ -260,7 +260,7 @@ struct super_block *freeze_bdev(struct b "VFS:Filesystem freeze failed\n"); sb->s_frozen = SB_UNFROZEN; drop_super(sb); - up(&bdev->bd_mount_sem); + mutex_unlock(&bdev->bd_mount_sem); bdev->bd_fsfreeze_count--; mutex_unlock(&bdev->bd_fsfreeze_mutex); return ERR_PTR(error); @@ -321,7 +321,7 @@ int thaw_bdev(struct block_device *bdev, drop_super(sb); } - up(&bdev->bd_mount_sem); + mutex_unlock(&bdev->bd_mount_sem); mutex_unlock(&bdev->bd_fsfreeze_mutex); return 0; } @@ -431,7 +431,7 @@ static void init_once(void *foo) memset(bdev, 0, sizeof(*bdev)); mutex_init(&bdev->bd_mutex); - sema_init(&bdev->bd_mount_sem, 1); + mutex_init(&bdev->bd_mount_sem); INIT_LIST_HEAD(&bdev->bd_inodes); INIT_LIST_HEAD(&bdev->bd_list); #ifdef CONFIG_SYSFS Index: linux-2.6-tip/fs/super.c =================================================================== --- linux-2.6-tip.orig/fs/super.c +++ linux-2.6-tip/fs/super.c @@ -740,9 +740,9 @@ int get_sb_bdev(struct file_system_type * will protect the lockfs code from trying to start a snapshot * while we are mounting */ - down(&bdev->bd_mount_sem); + mutex_lock(&bdev->bd_mount_sem); s = sget(fs_type, test_bdev_super, set_bdev_super, bdev); - up(&bdev->bd_mount_sem); + mutex_unlock(&bdev->bd_mount_sem); if (IS_ERR(s)) goto error_s; Index: linux-2.6-tip/include/linux/fs.h =================================================================== --- linux-2.6-tip.orig/include/linux/fs.h +++ linux-2.6-tip/include/linux/fs.h @@ -640,7 +640,7 @@ struct block_device { struct super_block * bd_super; int bd_openers; struct mutex bd_mutex; /* open/close mutex */ - struct semaphore bd_mount_sem; + struct mutex bd_mount_sem; struct list_head bd_inodes; void * bd_holder; int bd_holders; -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/