summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2010-10-27 21:39:58 +0200
committerArnd Bergmann <arnd@arndb.de>2010-10-27 22:07:36 +0200
commit72f98e72551fad573c6cace8e8551ef094f482dd (patch)
treefeeb5484ee69d3c9a9ef890037361f9ce55a42c4
parentf7347ce4ee7c65415f84be915c018473e7076f31 (diff)
downloadlinux-72f98e72551fad573c6cace8e8551ef094f482dd.tar.bz2
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>
-rw-r--r--fs/Kconfig1
-rw-r--r--fs/locks.c5
2 files changed, 3 insertions, 3 deletions
diff --git a/fs/Kconfig b/fs/Kconfig
index 65781de44fc0..3d185308ec88 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 # while lockd still uses it.
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 85fd9ce1abae..74c3df99c0e1 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);