Skip to content

Commit 72f98e7

Browse files
committed
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>
1 parent f7347ce commit 72f98e7

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

fs/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ endif # BLOCK
5050
config FILE_LOCKING
5151
bool "Enable POSIX file locking API" if EMBEDDED
5252
default y
53-
select BKL # while lockd still uses it.
5453
help
5554
This option enables standard file locking support, required
5655
for filesystems like NFS and for the flock() system

fs/locks.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,20 +142,21 @@ int lease_break_time = 45;
142142

143143
static LIST_HEAD(file_lock_list);
144144
static LIST_HEAD(blocked_list);
145+
static DEFINE_SPINLOCK(file_lock_lock);
145146

146147
/*
147148
* Protects the two list heads above, plus the inode->i_flock list
148149
* FIXME: should use a spinlock, once lockd and ceph are ready.
149150
*/
150151
void lock_flocks(void)
151152
{
152-
lock_kernel();
153+
spin_lock(&file_lock_lock);
153154
}
154155
EXPORT_SYMBOL_GPL(lock_flocks);
155156

156157
void unlock_flocks(void)
157158
{
158-
unlock_kernel();
159+
spin_unlock(&file_lock_lock);
159160
}
160161
EXPORT_SYMBOL_GPL(unlock_flocks);
161162

0 commit comments

Comments
 (0)