diff mbox

[v2] Remaining BKL users, what to do

Message ID 201010181938.27076.arnd@arndb.de (mailing list archive)
State Not Applicable
Headers show

Commit Message

Arnd Bergmann Oct. 18, 2010, 5:38 p.m. UTC
None
diff mbox

Patch

diff --git a/fs/Kconfig b/fs/Kconfig
index c386a9f..25ce2dc 100644
--- a/fs/Kconfig
+++ b/fs/Kconfig
@@ -50,7 +50,6 @@  endif # BLOCK
 config FILE_LOCKING
 	bool "Enable POSIX file locking API" if EMBEDDED
 	default y
-	select BKL
 	help
 	  This option enables standard file locking support, required
           for filesystems like NFS and for the flock() system
diff --git a/fs/locks.c b/fs/locks.c
index 8b2b6ad..02b6e0e 100644
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -142,6 +142,7 @@  int lease_break_time = 45;
 
 static LIST_HEAD(file_lock_list);
 static LIST_HEAD(blocked_list);
+static DEFINE_SPINLOCK(file_lock_lock);
 
 /*
  * Protects the two list heads above, plus the inode->i_flock list
@@ -149,13 +150,13 @@  static LIST_HEAD(blocked_list);
  */
 void lock_flocks(void)
 {
-	lock_kernel();
+	spin_lock(&file_lock_lock);
 }
 EXPORT_SYMBOL_GPL(lock_flocks);
 
 void unlock_flocks(void)
 {
-	unlock_kernel();
+	spin_unlock(&file_lock_lock);
 }
 EXPORT_SYMBOL_GPL(unlock_flocks);