From patchwork Mon Oct 18 17:38:26 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [v2] Remaining BKL users, what to do Date: Mon, 18 Oct 2010 17:38:26 -0000 From: Arnd Bergmann X-Patchwork-Id: 262561 Message-Id: <201010181938.27076.arnd@arndb.de> To: Christoph Hellwig Cc: codalist@TELEMANN.coda.cs.cmu.edu, ksummit-2010-discuss@lists.linux-foundation.org, autofs@linux.kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, Mikulas Patocka , Trond Myklebust , Petr Vandrovec , Anders Larsen , Jan Kara , Evgeniy Dushistov , Ingo Molnar , netdev@vger.kernel.org, Samuel Ortiz , Arnaldo Carvalho de Melo , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Andrew Hendry , David Miller , Jan Harkes , Bryan Schumaker 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 # 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 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);