aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/scsi/zfcp_sysfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/scsi/zfcp_sysfs.c')
-rw-r--r--drivers/s390/scsi/zfcp_sysfs.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/drivers/s390/scsi/zfcp_sysfs.c b/drivers/s390/scsi/zfcp_sysfs.c
index 0fe5cce818cb..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); \
107out: \ 107out: \
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} \
111static ZFCP_DEV_ATTR(_feat, failed, S_IWUSR | S_IRUGO, \ 111static ZFCP_DEV_ATTR(_feat, failed, S_IWUSR | S_IRUGO, \
@@ -126,7 +126,7 @@ static ssize_t zfcp_sysfs_port_rescan_store(struct device *dev,
126 if (atomic_read(&adapter->status) & ZFCP_STATUS_COMMON_REMOVE) 126 if (atomic_read(&adapter->status) & ZFCP_STATUS_COMMON_REMOVE)
127 return -EBUSY; 127 return -EBUSY;
128 128
129 ret = zfcp_scan_ports(adapter); 129 ret = zfcp_fc_scan_ports(adapter);
130 return ret ? ret : (ssize_t) count; 130 return ret ? ret : (ssize_t) count;
131} 131}
132static ZFCP_DEV_ATTR(adapter, port_rescan, S_IWUSR, NULL, 132static ZFCP_DEV_ATTR(adapter, port_rescan, S_IWUSR, NULL,
@@ -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}
179static ZFCP_DEV_ATTR(adapter, port_remove, S_IWUSR, NULL, 179static 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);
228out: 228out:
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}
232static DEVICE_ATTR(unit_add, S_IWUSR, NULL, zfcp_sysfs_unit_add_store); 232static 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);
284out: 284out:
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}
288static DEVICE_ATTR(unit_remove, S_IWUSR, NULL, zfcp_sysfs_unit_remove_store); 288static DEVICE_ATTR(unit_remove, S_IWUSR, NULL, zfcp_sysfs_unit_remove_store);
@@ -425,7 +425,7 @@ static ssize_t zfcp_sysfs_adapter_util_show(struct device *dev,
425 if (!qtcb_port) 425 if (!qtcb_port)
426 return -ENOMEM; 426 return -ENOMEM;
427 427
428 retval = zfcp_fsf_exchange_port_data_sync(adapter, qtcb_port); 428 retval = zfcp_fsf_exchange_port_data_sync(adapter->qdio, qtcb_port);
429 if (!retval) 429 if (!retval)
430 retval = sprintf(buf, "%u %u %u\n", qtcb_port->cp_util, 430 retval = sprintf(buf, "%u %u %u\n", qtcb_port->cp_util,
431 qtcb_port->cb_util, qtcb_port->a_util); 431 qtcb_port->cb_util, qtcb_port->a_util);
@@ -451,7 +451,7 @@ static int zfcp_sysfs_adapter_ex_config(struct device *dev,
451 if (!qtcb_config) 451 if (!qtcb_config)
452 return -ENOMEM; 452 return -ENOMEM;
453 453
454 retval = zfcp_fsf_exchange_config_data_sync(adapter, qtcb_config); 454 retval = zfcp_fsf_exchange_config_data_sync(adapter->qdio, qtcb_config);
455 if (!retval) 455 if (!retval)
456 *stat_inf = qtcb_config->stat_info; 456 *stat_inf = qtcb_config->stat_info;
457 457
@@ -492,15 +492,15 @@ static ssize_t zfcp_sysfs_adapter_q_full_show(struct device *dev,
492 char *buf) 492 char *buf)
493{ 493{
494 struct Scsi_Host *scsi_host = class_to_shost(dev); 494 struct Scsi_Host *scsi_host = class_to_shost(dev);
495 struct zfcp_adapter *adapter = 495 struct zfcp_qdio *qdio =
496 (struct zfcp_adapter *) scsi_host->hostdata[0]; 496 ((struct zfcp_adapter *) scsi_host->hostdata[0])->qdio;
497 u64 util; 497 u64 util;
498 498
499 spin_lock_bh(&adapter->qdio_stat_lock); 499 spin_lock_bh(&qdio->stat_lock);
500 util = adapter->req_q_util; 500 util = qdio->req_q_util;
501 spin_unlock_bh(&adapter->qdio_stat_lock); 501 spin_unlock_bh(&qdio->stat_lock);
502 502
503 return sprintf(buf, "%d %llu\n", atomic_read(&adapter->qdio_outb_full), 503 return sprintf(buf, "%d %llu\n", atomic_read(&qdio->req_q_full),
504 (unsigned long long)util); 504 (unsigned long long)util);
505} 505}
506static DEVICE_ATTR(queue_full, S_IRUGO, zfcp_sysfs_adapter_q_full_show, NULL); 506static DEVICE_ATTR(queue_full, S_IRUGO, zfcp_sysfs_adapter_q_full_show, NULL);