Commit e9d6bbc4 authored by Artem Bityutskiy's avatar Artem Bityutskiy

UBIFS: kill BKL

The BKL was pushed down from VFS to the file-systems. It used
to serialize mount/unmount/remount and prevented more than one
instance of the same file-system from doing
mount/umount/remount at the same time. But it is OK for UBIFS
and it does not need any additional locking for these cases.
Thus, kick the BKL out of UBIFS.
Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
parent b5148da4
...@@ -36,7 +36,6 @@ ...@@ -36,7 +36,6 @@
#include <linux/mount.h> #include <linux/mount.h>
#include <linux/math64.h> #include <linux/math64.h>
#include <linux/writeback.h> #include <linux/writeback.h>
#include <linux/smp_lock.h>
#include "ubifs.h" #include "ubifs.h"
/* /*
...@@ -1726,8 +1725,6 @@ static void ubifs_put_super(struct super_block *sb) ...@@ -1726,8 +1725,6 @@ static void ubifs_put_super(struct super_block *sb)
ubifs_msg("un-mount UBI device %d, volume %d", c->vi.ubi_num, ubifs_msg("un-mount UBI device %d, volume %d", c->vi.ubi_num,
c->vi.vol_id); c->vi.vol_id);
lock_kernel();
/* /*
* The following asserts are only valid if there has not been a failure * The following asserts are only valid if there has not been a failure
* of the media. For example, there will be dirty inodes if we failed * of the media. For example, there will be dirty inodes if we failed
...@@ -1792,8 +1789,6 @@ static void ubifs_put_super(struct super_block *sb) ...@@ -1792,8 +1789,6 @@ static void ubifs_put_super(struct super_block *sb)
ubi_close_volume(c->ubi); ubi_close_volume(c->ubi);
mutex_unlock(&c->umount_mutex); mutex_unlock(&c->umount_mutex);
kfree(c); kfree(c);
unlock_kernel();
} }
static int ubifs_remount_fs(struct super_block *sb, int *flags, char *data) static int ubifs_remount_fs(struct super_block *sb, int *flags, char *data)
...@@ -1809,22 +1804,17 @@ static int ubifs_remount_fs(struct super_block *sb, int *flags, char *data) ...@@ -1809,22 +1804,17 @@ static int ubifs_remount_fs(struct super_block *sb, int *flags, char *data)
return err; return err;
} }
lock_kernel();
if ((sb->s_flags & MS_RDONLY) && !(*flags & MS_RDONLY)) { if ((sb->s_flags & MS_RDONLY) && !(*flags & MS_RDONLY)) {
if (c->ro_media) { if (c->ro_media) {
ubifs_msg("cannot re-mount due to prior errors"); ubifs_msg("cannot re-mount due to prior errors");
unlock_kernel();
return -EROFS; return -EROFS;
} }
err = ubifs_remount_rw(c); err = ubifs_remount_rw(c);
if (err) { if (err)
unlock_kernel();
return err; return err;
}
} else if (!(sb->s_flags & MS_RDONLY) && (*flags & MS_RDONLY)) { } else if (!(sb->s_flags & MS_RDONLY) && (*flags & MS_RDONLY)) {
if (c->ro_media) { if (c->ro_media) {
ubifs_msg("cannot re-mount due to prior errors"); ubifs_msg("cannot re-mount due to prior errors");
unlock_kernel();
return -EROFS; return -EROFS;
} }
ubifs_remount_ro(c); ubifs_remount_ro(c);
...@@ -1839,7 +1829,6 @@ static int ubifs_remount_fs(struct super_block *sb, int *flags, char *data) ...@@ -1839,7 +1829,6 @@ static int ubifs_remount_fs(struct super_block *sb, int *flags, char *data)
} }
ubifs_assert(c->lst.taken_empty_lebs > 0); ubifs_assert(c->lst.taken_empty_lebs > 0);
unlock_kernel();
return 0; return 0;
} }
......
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