Commit 2e272570 authored by Thomas Gleixner's avatar Thomas Gleixner

fs: Convert bd_mount_sem to mutex

bd_mount_sem is used as mutex so make it a mutex.
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Cc: Al Viro <viro@zeniv.linux.org.uk>
parent 041e3130
......@@ -240,7 +240,7 @@ struct super_block *freeze_bdev(struct block_device *bdev)
}
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 block_device *bdev)
"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, struct super_block *sb)
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
......
......@@ -740,9 +740,9 @@ int get_sb_bdev(struct file_system_type *fs_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;
......
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment