aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2009-07-19 06:51:04 -0400
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2009-07-24 08:14:54 -0400
commite9d6bbc428bdf0c08bbd0b3f28db2b7317cfff21 (patch)
treeec306cfd64f3ae1926b5a92379d072791458b710
parentb5148da40cb77ca84c4b0281e7049bb26d786592 (diff)
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: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
-rw-r--r--fs/ubifs/super.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
index 26d2e0d80465..13e7ed4188ea 100644
--- a/fs/ubifs/super.c
+++ b/fs/ubifs/super.c
@@ -36,7 +36,6 @@
36#include <linux/mount.h> 36#include <linux/mount.h>
37#include <linux/math64.h> 37#include <linux/math64.h>
38#include <linux/writeback.h> 38#include <linux/writeback.h>
39#include <linux/smp_lock.h>
40#include "ubifs.h" 39#include "ubifs.h"
41 40
42/* 41/*
@@ -1726,8 +1725,6 @@ static void ubifs_put_super(struct super_block *sb)
1726 ubifs_msg("un-mount UBI device %d, volume %d", c->vi.ubi_num, 1725 ubifs_msg("un-mount UBI device %d, volume %d", c->vi.ubi_num,
1727 c->vi.vol_id); 1726 c->vi.vol_id);
1728 1727
1729 lock_kernel();
1730
1731 /* 1728 /*
1732 * The following asserts are only valid if there has not been a failure 1729 * The following asserts are only valid if there has not been a failure
1733 * of the media. For example, there will be dirty inodes if we failed 1730 * 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 ubi_close_volume(c->ubi); 1789 ubi_close_volume(c->ubi);
1793 mutex_unlock(&c->umount_mutex); 1790 mutex_unlock(&c->umount_mutex);
1794 kfree(c); 1791 kfree(c);
1795
1796 unlock_kernel();
1797} 1792}
1798 1793
1799static int ubifs_remount_fs(struct super_block *sb, int *flags, char *data) 1794static 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 return err; 1804 return err;
1810 } 1805 }
1811 1806
1812 lock_kernel();
1813 if ((sb->s_flags & MS_RDONLY) && !(*flags & MS_RDONLY)) { 1807 if ((sb->s_flags & MS_RDONLY) && !(*flags & MS_RDONLY)) {
1814 if (c->ro_media) { 1808 if (c->ro_media) {
1815 ubifs_msg("cannot re-mount due to prior errors"); 1809 ubifs_msg("cannot re-mount due to prior errors");
1816 unlock_kernel();
1817 return -EROFS; 1810 return -EROFS;
1818 } 1811 }
1819 err = ubifs_remount_rw(c); 1812 err = ubifs_remount_rw(c);
1820 if (err) { 1813 if (err)
1821 unlock_kernel();
1822 return err; 1814 return err;
1823 }
1824 } else if (!(sb->s_flags & MS_RDONLY) && (*flags & MS_RDONLY)) { 1815 } else if (!(sb->s_flags & MS_RDONLY) && (*flags & MS_RDONLY)) {
1825 if (c->ro_media) { 1816 if (c->ro_media) {
1826 ubifs_msg("cannot re-mount due to prior errors"); 1817 ubifs_msg("cannot re-mount due to prior errors");
1827 unlock_kernel();
1828 return -EROFS; 1818 return -EROFS;
1829 } 1819 }
1830 ubifs_remount_ro(c); 1820 ubifs_remount_ro(c);
@@ -1839,7 +1829,6 @@ static int ubifs_remount_fs(struct super_block *sb, int *flags, char *data)
1839 } 1829 }
1840 1830
1841 ubifs_assert(c->lst.taken_empty_lebs > 0); 1831 ubifs_assert(c->lst.taken_empty_lebs > 0);
1842 unlock_kernel();
1843 return 0; 1832 return 0;
1844} 1833}
1845 1834