Эх сурвалжийг харах

locks: turn lock_flocks into a spinlock

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>
Arnd Bergmann 14 жил өмнө
parent
commit
72f98e7255
2 өөрчлөгдсөн 3 нэмэгдсэн , 3 устгасан
  1. 0 1
      fs/Kconfig
  2. 3 2
      fs/locks.c

+ 0 - 1
fs/Kconfig

@@ -50,7 +50,6 @@ endif # BLOCK
 config FILE_LOCKING
 config FILE_LOCKING
 	bool "Enable POSIX file locking API" if EMBEDDED
 	bool "Enable POSIX file locking API" if EMBEDDED
 	default y
 	default y
-	select BKL # while lockd still uses it.
 	help
 	help
 	  This option enables standard file locking support, required
 	  This option enables standard file locking support, required
           for filesystems like NFS and for the flock() system
           for filesystems like NFS and for the flock() system

+ 3 - 2
fs/locks.c

@@ -142,6 +142,7 @@ int lease_break_time = 45;
 
 
 static LIST_HEAD(file_lock_list);
 static LIST_HEAD(file_lock_list);
 static LIST_HEAD(blocked_list);
 static LIST_HEAD(blocked_list);
+static DEFINE_SPINLOCK(file_lock_lock);
 
 
 /*
 /*
  * Protects the two list heads above, plus the inode->i_flock list
  * 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)
 void lock_flocks(void)
 {
 {
-	lock_kernel();
+	spin_lock(&file_lock_lock);
 }
 }
 EXPORT_SYMBOL_GPL(lock_flocks);
 EXPORT_SYMBOL_GPL(lock_flocks);
 
 
 void unlock_flocks(void)
 void unlock_flocks(void)
 {
 {
-	unlock_kernel();
+	spin_unlock(&file_lock_lock);
 }
 }
 EXPORT_SYMBOL_GPL(unlock_flocks);
 EXPORT_SYMBOL_GPL(unlock_flocks);