diff options
author | Jonathan Corbet <corbet@lwn.net> | 2008-05-15 12:01:17 -0400 |
---|---|---|
committer | Jonathan Corbet <corbet@lwn.net> | 2008-06-20 16:03:43 -0400 |
commit | 764a4a8e54cdd6efc5928f876aa9e35778f22377 (patch) | |
tree | 76300e77269d5c3122b3e52d925baea8a4e84253 /drivers/s390/char/vmlogrdr.c | |
parent | 51a776fa7a7997e726d4a478eda0854c6f9143bd (diff) |
drivers/s390: cdev lock_kernel() pushdown
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'drivers/s390/char/vmlogrdr.c')
-rw-r--r-- | drivers/s390/char/vmlogrdr.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/s390/char/vmlogrdr.c b/drivers/s390/char/vmlogrdr.c index e8487347e4d4..d101328a2980 100644 --- a/drivers/s390/char/vmlogrdr.c +++ b/drivers/s390/char/vmlogrdr.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/kmod.h> | 25 | #include <linux/kmod.h> |
26 | #include <linux/cdev.h> | 26 | #include <linux/cdev.h> |
27 | #include <linux/device.h> | 27 | #include <linux/device.h> |
28 | #include <linux/smp_lock.h> | ||
28 | #include <linux/string.h> | 29 | #include <linux/string.h> |
29 | 30 | ||
30 | 31 | ||
@@ -319,9 +320,11 @@ static int vmlogrdr_open (struct inode *inode, struct file *filp) | |||
319 | return -ENOSYS; | 320 | return -ENOSYS; |
320 | 321 | ||
321 | /* Besure this device hasn't already been opened */ | 322 | /* Besure this device hasn't already been opened */ |
323 | lock_kernel(); | ||
322 | spin_lock_bh(&logptr->priv_lock); | 324 | spin_lock_bh(&logptr->priv_lock); |
323 | if (logptr->dev_in_use) { | 325 | if (logptr->dev_in_use) { |
324 | spin_unlock_bh(&logptr->priv_lock); | 326 | spin_unlock_bh(&logptr->priv_lock); |
327 | unlock_kernel(); | ||
325 | return -EBUSY; | 328 | return -EBUSY; |
326 | } | 329 | } |
327 | logptr->dev_in_use = 1; | 330 | logptr->dev_in_use = 1; |
@@ -365,7 +368,9 @@ static int vmlogrdr_open (struct inode *inode, struct file *filp) | |||
365 | || (logptr->iucv_path_severed)); | 368 | || (logptr->iucv_path_severed)); |
366 | if (logptr->iucv_path_severed) | 369 | if (logptr->iucv_path_severed) |
367 | goto out_record; | 370 | goto out_record; |
368 | return nonseekable_open(inode, filp); | 371 | ret = nonseekable_open(inode, filp); |
372 | unlock_kernel(); | ||
373 | return ret; | ||
369 | 374 | ||
370 | out_record: | 375 | out_record: |
371 | if (logptr->autorecording) | 376 | if (logptr->autorecording) |
@@ -375,6 +380,7 @@ out_path: | |||
375 | logptr->path = NULL; | 380 | logptr->path = NULL; |
376 | out_dev: | 381 | out_dev: |
377 | logptr->dev_in_use = 0; | 382 | logptr->dev_in_use = 0; |
383 | unlock_kernel(); | ||
378 | return -EIO; | 384 | return -EIO; |
379 | } | 385 | } |
380 | 386 | ||