aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/char/vmur.h
diff options
context:
space:
mode:
authorFrank Munzert <munzert@de.ibm.com>2008-04-17 01:46:06 -0400
committerHeiko Carstens <heiko.carstens@de.ibm.com>2008-04-17 01:46:59 -0400
commita695f16729e00995fe72baf0e8bee4bf9c232ae0 (patch)
tree2fddf1722972564e33eedbedf9010bdd9735a74d /drivers/s390/char/vmur.h
parent92bf435f383a6193d59c687ce87ccca3529c68a1 (diff)
[S390] vmur: Use wait queue instead of mutex to serialize open
If user space opens a unit record device node then vmur is leaving the kernel with lock open_mutex still held to prevent other processes from opening the device simultaneously. This causes lockdep to complain about a lock held when returning to user space. Now the mutex is replaced by a wait queue to serialize device open. Signed-off-by: Frank Munzert <munzert@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Diffstat (limited to 'drivers/s390/char/vmur.h')
-rw-r--r--drivers/s390/char/vmur.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/s390/char/vmur.h b/drivers/s390/char/vmur.h
index fa959644735a..fa320ad4593d 100644
--- a/drivers/s390/char/vmur.h
+++ b/drivers/s390/char/vmur.h
@@ -62,7 +62,6 @@ struct file_control_block {
62struct urdev { 62struct urdev {
63 struct ccw_device *cdev; /* Backpointer to ccw device */ 63 struct ccw_device *cdev; /* Backpointer to ccw device */
64 struct mutex io_mutex; /* Serialises device IO */ 64 struct mutex io_mutex; /* Serialises device IO */
65 struct mutex open_mutex; /* Serialises access to device */
66 struct completion *io_done; /* do_ur_io waits; irq completes */ 65 struct completion *io_done; /* do_ur_io waits; irq completes */
67 struct device *device; 66 struct device *device;
68 struct cdev *char_device; 67 struct cdev *char_device;
@@ -71,6 +70,9 @@ struct urdev {
71 int class; /* VM device class */ 70 int class; /* VM device class */
72 int io_request_rc; /* return code from I/O request */ 71 int io_request_rc; /* return code from I/O request */
73 atomic_t ref_count; /* reference counter */ 72 atomic_t ref_count; /* reference counter */
73 wait_queue_head_t wait; /* wait queue to serialize open */
74 int open_flag; /* "urdev is open" flag */
75 spinlock_t open_lock; /* serialize critical sections */
74}; 76};
75 77
76/* 78/*