linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] UBIFS: kill BKL
@ 2009-07-19 10:55 Artem Bityutskiy
  2009-07-20  6:16 ` Adrian Hunter
  2009-07-20 12:51 ` Christoph Hellwig
  0 siblings, 2 replies; 8+ messages in thread
From: Artem Bityutskiy @ 2009-07-19 10:55 UTC (permalink / raw)
  To: linux-fsdevel; +Cc: Adrian Hunter, Artem Bityutskiy

From: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>

The BKL was pushed down from VFS to the file-systems. It used
to serialize mount/unmount/remount. UBIFS must be safe if several
file-systems are mounted/unmounted/re-mounted at the same time,
so kill kick the BKL out of UBIFS.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
---
 fs/ubifs/super.c |   15 ++-------------
 1 files changed, 2 insertions(+), 13 deletions(-)

diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
index 26d2e0d..4ad992f 100644
--- a/fs/ubifs/super.c
+++ b/fs/ubifs/super.c
@@ -1726,8 +1726,6 @@ static void ubifs_put_super(struct super_block *sb)
 	ubifs_msg("un-mount UBI device %d, volume %d", c->vi.ubi_num,
 		  c->vi.vol_id);
 
-	lock_kernel();
-
 	/*
 	 * 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
@@ -1792,8 +1790,6 @@ static void ubifs_put_super(struct super_block *sb)
 	ubi_close_volume(c->ubi);
 	mutex_unlock(&c->umount_mutex);
 	kfree(c);
-
-	unlock_kernel();
 }
 
 static int ubifs_remount_fs(struct super_block *sb, int *flags, char *data)
@@ -1809,24 +1805,18 @@ static int ubifs_remount_fs(struct super_block *sb, int *flags, char *data)
 		return err;
 	}
 
-	lock_kernel();
 	if ((sb->s_flags & MS_RDONLY) && !(*flags & MS_RDONLY)) {
 		if (c->ro_media) {
 			ubifs_msg("cannot re-mount due to prior errors");
-			unlock_kernel();
 			return -EROFS;
 		}
 		err = ubifs_remount_rw(c);
-		if (err) {
-			unlock_kernel();
+		if (err)
 			return err;
-		}
 	} 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");
-			unlock_kernel();
 			return -EROFS;
-		}
 		ubifs_remount_ro(c);
 	}
 
@@ -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);
-	unlock_kernel();
 	return 0;
 }
 
-- 
1.6.0.6


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-07-20 13:23 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-19 10:55 [PATCH] UBIFS: kill BKL Artem Bityutskiy
2009-07-20  6:16 ` Adrian Hunter
2009-07-20  6:27   ` Artem Bityutskiy
2009-07-20  6:29   ` Artem Bityutskiy
2009-07-20  6:35     ` Adrian Hunter
2009-07-20 10:26   ` Artem Bityutskiy
2009-07-20 12:51 ` Christoph Hellwig
2009-07-20 13:22   ` Artem Bityutskiy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).