diff options
author | Christof Schmitt <christof.schmitt@de.ibm.com> | 2009-08-18 09:43:28 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2009-09-05 09:49:42 -0400 |
commit | 24680defdb55e073c5e43d14318a164b842d8ce7 (patch) | |
tree | d1d054c831d85b175e560c562694a265f00a9191 /drivers/s390/scsi/zfcp_sysfs.c | |
parent | 143bb6bfe36d20618d8bf667915fe14d14b8ae2f (diff) |
[SCSI] zfcp: Replace config semaphore with mutex
The config semaphore is only used as a mutex, so replace it with a
simple mutex.
Reviewed-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/s390/scsi/zfcp_sysfs.c')
-rw-r--r-- | drivers/s390/scsi/zfcp_sysfs.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/s390/scsi/zfcp_sysfs.c b/drivers/s390/scsi/zfcp_sysfs.c index c86496bb608b..079a8cf518a3 100644 --- a/drivers/s390/scsi/zfcp_sysfs.c +++ b/drivers/s390/scsi/zfcp_sysfs.c | |||
@@ -88,7 +88,7 @@ static ssize_t zfcp_sysfs_##_feat##_failed_store(struct device *dev, \ | |||
88 | unsigned long val; \ | 88 | unsigned long val; \ |
89 | int retval = 0; \ | 89 | int retval = 0; \ |
90 | \ | 90 | \ |
91 | down(&zfcp_data.config_sema); \ | 91 | mutex_lock(&zfcp_data.config_mutex); \ |
92 | if (atomic_read(&_feat->status) & ZFCP_STATUS_COMMON_REMOVE) { \ | 92 | if (atomic_read(&_feat->status) & ZFCP_STATUS_COMMON_REMOVE) { \ |
93 | retval = -EBUSY; \ | 93 | retval = -EBUSY; \ |
94 | goto out; \ | 94 | goto out; \ |
@@ -105,7 +105,7 @@ static ssize_t zfcp_sysfs_##_feat##_failed_store(struct device *dev, \ | |||
105 | _reopen_id, NULL); \ | 105 | _reopen_id, NULL); \ |
106 | zfcp_erp_wait(_adapter); \ | 106 | zfcp_erp_wait(_adapter); \ |
107 | out: \ | 107 | out: \ |
108 | up(&zfcp_data.config_sema); \ | 108 | mutex_unlock(&zfcp_data.config_mutex); \ |
109 | return retval ? retval : (ssize_t) count; \ | 109 | return retval ? retval : (ssize_t) count; \ |
110 | } \ | 110 | } \ |
111 | static ZFCP_DEV_ATTR(_feat, failed, S_IWUSR | S_IRUGO, \ | 111 | static ZFCP_DEV_ATTR(_feat, failed, S_IWUSR | S_IRUGO, \ |
@@ -142,7 +142,7 @@ static ssize_t zfcp_sysfs_port_remove_store(struct device *dev, | |||
142 | int retval = 0; | 142 | int retval = 0; |
143 | LIST_HEAD(port_remove_lh); | 143 | LIST_HEAD(port_remove_lh); |
144 | 144 | ||
145 | down(&zfcp_data.config_sema); | 145 | mutex_lock(&zfcp_data.config_mutex); |
146 | if (atomic_read(&adapter->status) & ZFCP_STATUS_COMMON_REMOVE) { | 146 | if (atomic_read(&adapter->status) & ZFCP_STATUS_COMMON_REMOVE) { |
147 | retval = -EBUSY; | 147 | retval = -EBUSY; |
148 | goto out; | 148 | goto out; |
@@ -173,7 +173,7 @@ static ssize_t zfcp_sysfs_port_remove_store(struct device *dev, | |||
173 | zfcp_port_put(port); | 173 | zfcp_port_put(port); |
174 | zfcp_port_dequeue(port); | 174 | zfcp_port_dequeue(port); |
175 | out: | 175 | out: |
176 | up(&zfcp_data.config_sema); | 176 | mutex_unlock(&zfcp_data.config_mutex); |
177 | return retval ? retval : (ssize_t) count; | 177 | return retval ? retval : (ssize_t) count; |
178 | } | 178 | } |
179 | static ZFCP_DEV_ATTR(adapter, port_remove, S_IWUSR, NULL, | 179 | static ZFCP_DEV_ATTR(adapter, port_remove, S_IWUSR, NULL, |
@@ -207,7 +207,7 @@ static ssize_t zfcp_sysfs_unit_add_store(struct device *dev, | |||
207 | u64 fcp_lun; | 207 | u64 fcp_lun; |
208 | int retval = -EINVAL; | 208 | int retval = -EINVAL; |
209 | 209 | ||
210 | down(&zfcp_data.config_sema); | 210 | mutex_lock(&zfcp_data.config_mutex); |
211 | if (atomic_read(&port->status) & ZFCP_STATUS_COMMON_REMOVE) { | 211 | if (atomic_read(&port->status) & ZFCP_STATUS_COMMON_REMOVE) { |
212 | retval = -EBUSY; | 212 | retval = -EBUSY; |
213 | goto out; | 213 | goto out; |
@@ -226,7 +226,7 @@ static ssize_t zfcp_sysfs_unit_add_store(struct device *dev, | |||
226 | zfcp_erp_wait(unit->port->adapter); | 226 | zfcp_erp_wait(unit->port->adapter); |
227 | zfcp_unit_put(unit); | 227 | zfcp_unit_put(unit); |
228 | out: | 228 | out: |
229 | up(&zfcp_data.config_sema); | 229 | mutex_unlock(&zfcp_data.config_mutex); |
230 | return retval ? retval : (ssize_t) count; | 230 | return retval ? retval : (ssize_t) count; |
231 | } | 231 | } |
232 | static DEVICE_ATTR(unit_add, S_IWUSR, NULL, zfcp_sysfs_unit_add_store); | 232 | static DEVICE_ATTR(unit_add, S_IWUSR, NULL, zfcp_sysfs_unit_add_store); |
@@ -241,7 +241,7 @@ static ssize_t zfcp_sysfs_unit_remove_store(struct device *dev, | |||
241 | int retval = 0; | 241 | int retval = 0; |
242 | LIST_HEAD(unit_remove_lh); | 242 | LIST_HEAD(unit_remove_lh); |
243 | 243 | ||
244 | down(&zfcp_data.config_sema); | 244 | mutex_lock(&zfcp_data.config_mutex); |
245 | if (atomic_read(&port->status) & ZFCP_STATUS_COMMON_REMOVE) { | 245 | if (atomic_read(&port->status) & ZFCP_STATUS_COMMON_REMOVE) { |
246 | retval = -EBUSY; | 246 | retval = -EBUSY; |
247 | goto out; | 247 | goto out; |
@@ -282,7 +282,7 @@ static ssize_t zfcp_sysfs_unit_remove_store(struct device *dev, | |||
282 | zfcp_unit_put(unit); | 282 | zfcp_unit_put(unit); |
283 | zfcp_unit_dequeue(unit); | 283 | zfcp_unit_dequeue(unit); |
284 | out: | 284 | out: |
285 | up(&zfcp_data.config_sema); | 285 | mutex_unlock(&zfcp_data.config_mutex); |
286 | return retval ? retval : (ssize_t) count; | 286 | return retval ? retval : (ssize_t) count; |
287 | } | 287 | } |
288 | static DEVICE_ATTR(unit_remove, S_IWUSR, NULL, zfcp_sysfs_unit_remove_store); | 288 | static DEVICE_ATTR(unit_remove, S_IWUSR, NULL, zfcp_sysfs_unit_remove_store); |