]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
locks: turn lock_flocks into a spinlock
authorArnd Bergmann <arnd@arndb.de>
Wed, 27 Oct 2010 19:39:58 +0000 (21:39 +0200)
committerArnd Bergmann <arnd@arndb.de>
Wed, 27 Oct 2010 20:07:36 +0000 (22:07 +0200)
Nothing depends on lock_flocks using the BKL
any more, so we can do the switch over to
a private spinlock.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
fs/Kconfig
fs/locks.c

index 65781de44fc0e04998d3daa2bee8b51e215d9844..3d185308ec883bd0c06be0d151385c65e15b3353 100644 (file)
@@ -50,7 +50,6 @@ endif # BLOCK
 config FILE_LOCKING
        bool "Enable POSIX file locking API" if EMBEDDED
        default y
-       select BKL # while lockd still uses it.
        help
          This option enables standard file locking support, required
           for filesystems like NFS and for the flock() system
index 85fd9ce1abae6d97ca92fa3b2884c8732a169a60..74c3df99c0e144702d259991ed42c84d93593adf 100644 (file)
@@ -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);