aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/dtlk.c
diff options
context:
space:
mode:
authorJonathan Corbet <corbet@lwn.net>2008-05-18 17:32:43 -0400
committerJonathan Corbet <corbet@lwn.net>2008-06-20 16:05:53 -0400
commitf2b9857eee17797541b845782ade4d7a9d50f843 (patch)
tree914a00afee2ff953199f99f7cf869e3fd83b36bd /drivers/char/dtlk.c
parent0b2806768899dba5967bcd4a3b93eaed9a1dc4f3 (diff)
Add a bunch of cycle_kernel_lock() calls
All of the open() functions which don't need the BKL on their face may still depend on its acquisition to serialize opens against driver initialization. So make those functions acquire then release the BKL to be on the safe side. Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'drivers/char/dtlk.c')
-rw-r--r--drivers/char/dtlk.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/char/dtlk.c b/drivers/char/dtlk.c
index 433388c60235..6b900b297cc6 100644
--- a/drivers/char/dtlk.c
+++ b/drivers/char/dtlk.c
@@ -56,6 +56,7 @@
56#include <linux/errno.h> /* for -EBUSY */ 56#include <linux/errno.h> /* for -EBUSY */
57#include <linux/ioport.h> /* for request_region */ 57#include <linux/ioport.h> /* for request_region */
58#include <linux/delay.h> /* for loops_per_jiffy */ 58#include <linux/delay.h> /* for loops_per_jiffy */
59#include <linux/smp_lock.h> /* cycle_kernel_lock() */
59#include <asm/io.h> /* for inb_p, outb_p, inb, outb, etc. */ 60#include <asm/io.h> /* for inb_p, outb_p, inb, outb, etc. */
60#include <asm/uaccess.h> /* for get_user, etc. */ 61#include <asm/uaccess.h> /* for get_user, etc. */
61#include <linux/wait.h> /* for wait_queue */ 62#include <linux/wait.h> /* for wait_queue */
@@ -288,12 +289,12 @@ static int dtlk_ioctl(struct inode *inode,
288 } 289 }
289} 290}
290 291
291/* No BKL needed here; "dtlk_busy" is the only global resource, 292/* Note that nobody ever sets dtlk_busy... */
292 and it is not ever set by anybody (test is broken) */
293static int dtlk_open(struct inode *inode, struct file *file) 293static int dtlk_open(struct inode *inode, struct file *file)
294{ 294{
295 TRACE_TEXT("(dtlk_open"); 295 TRACE_TEXT("(dtlk_open");
296 296
297 cycle_kernel_lock();
297 nonseekable_open(inode, file); 298 nonseekable_open(inode, file);
298 switch (iminor(inode)) { 299 switch (iminor(inode)) {
299 case DTLK_MINOR: 300 case DTLK_MINOR: