diff options
author | Swen Schillig <swen@vnet.ibm.com> | 2009-11-24 10:53:58 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2009-12-04 13:02:01 -0500 |
commit | ecf0c7721b104c0ce9c8ca534c911f6310cf92a8 (patch) | |
tree | 639032b36bcbbe905c98c6f0b3b521dc2f0b1806 /drivers/s390/scsi/zfcp_fsf.c | |
parent | 0a55256d158c18e4821c248a295b7f8f4423660f (diff) |
[SCSI] zfcp: Replace global config_lock with local list locks
The global config_lock was used to protect the configuration organized
in independent lists. It is not necessary to have a lock on driver
level for this purpose. This patch replaces the global config_lock
with a set of local list locks.
Signed-off-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_fsf.c')
-rw-r--r-- | drivers/s390/scsi/zfcp_fsf.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c index 4e41baa0c141..9df62f686812 100644 --- a/drivers/s390/scsi/zfcp_fsf.c +++ b/drivers/s390/scsi/zfcp_fsf.c | |||
@@ -122,36 +122,32 @@ void zfcp_fsf_req_free(struct zfcp_fsf_req *req) | |||
122 | 122 | ||
123 | static void zfcp_fsf_status_read_port_closed(struct zfcp_fsf_req *req) | 123 | static void zfcp_fsf_status_read_port_closed(struct zfcp_fsf_req *req) |
124 | { | 124 | { |
125 | unsigned long flags; | ||
125 | struct fsf_status_read_buffer *sr_buf = req->data; | 126 | struct fsf_status_read_buffer *sr_buf = req->data; |
126 | struct zfcp_adapter *adapter = req->adapter; | 127 | struct zfcp_adapter *adapter = req->adapter; |
127 | struct zfcp_port *port; | 128 | struct zfcp_port *port; |
128 | int d_id = sr_buf->d_id & ZFCP_DID_MASK; | 129 | int d_id = sr_buf->d_id & ZFCP_DID_MASK; |
129 | unsigned long flags; | ||
130 | 130 | ||
131 | read_lock_irqsave(&zfcp_data.config_lock, flags); | 131 | read_lock_irqsave(&adapter->port_list_lock, flags); |
132 | list_for_each_entry(port, &adapter->port_list_head, list) | 132 | list_for_each_entry(port, &adapter->port_list, list) |
133 | if (port->d_id == d_id) { | 133 | if (port->d_id == d_id) { |
134 | read_unlock_irqrestore(&zfcp_data.config_lock, flags); | ||
135 | zfcp_erp_port_reopen(port, 0, "fssrpc1", req); | 134 | zfcp_erp_port_reopen(port, 0, "fssrpc1", req); |
136 | return; | 135 | break; |
137 | } | 136 | } |
138 | read_unlock_irqrestore(&zfcp_data.config_lock, flags); | 137 | read_unlock_irqrestore(&adapter->port_list_lock, flags); |
139 | } | 138 | } |
140 | 139 | ||
141 | static void zfcp_fsf_link_down_info_eval(struct zfcp_fsf_req *req, char *id, | 140 | static void zfcp_fsf_link_down_info_eval(struct zfcp_fsf_req *req, char *id, |
142 | struct fsf_link_down_info *link_down) | 141 | struct fsf_link_down_info *link_down) |
143 | { | 142 | { |
144 | struct zfcp_adapter *adapter = req->adapter; | 143 | struct zfcp_adapter *adapter = req->adapter; |
145 | unsigned long flags; | ||
146 | 144 | ||
147 | if (atomic_read(&adapter->status) & ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED) | 145 | if (atomic_read(&adapter->status) & ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED) |
148 | return; | 146 | return; |
149 | 147 | ||
150 | atomic_set_mask(ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED, &adapter->status); | 148 | atomic_set_mask(ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED, &adapter->status); |
151 | 149 | ||
152 | read_lock_irqsave(&zfcp_data.config_lock, flags); | ||
153 | zfcp_scsi_schedule_rports_block(adapter); | 150 | zfcp_scsi_schedule_rports_block(adapter); |
154 | read_unlock_irqrestore(&zfcp_data.config_lock, flags); | ||
155 | 151 | ||
156 | if (!link_down) | 152 | if (!link_down) |
157 | goto out; | 153 | goto out; |
@@ -1765,9 +1761,11 @@ static void zfcp_fsf_close_physical_port_handler(struct zfcp_fsf_req *req) | |||
1765 | /* can't use generic zfcp_erp_modify_port_status because | 1761 | /* can't use generic zfcp_erp_modify_port_status because |
1766 | * ZFCP_STATUS_COMMON_OPEN must not be reset for the port */ | 1762 | * ZFCP_STATUS_COMMON_OPEN must not be reset for the port */ |
1767 | atomic_clear_mask(ZFCP_STATUS_PORT_PHYS_OPEN, &port->status); | 1763 | atomic_clear_mask(ZFCP_STATUS_PORT_PHYS_OPEN, &port->status); |
1768 | list_for_each_entry(unit, &port->unit_list_head, list) | 1764 | read_lock(&port->unit_list_lock); |
1765 | list_for_each_entry(unit, &port->unit_list, list) | ||
1769 | atomic_clear_mask(ZFCP_STATUS_COMMON_OPEN, | 1766 | atomic_clear_mask(ZFCP_STATUS_COMMON_OPEN, |
1770 | &unit->status); | 1767 | &unit->status); |
1768 | read_unlock(&port->unit_list_lock); | ||
1771 | zfcp_erp_port_boxed(port, "fscpph2", req); | 1769 | zfcp_erp_port_boxed(port, "fscpph2", req); |
1772 | req->status |= ZFCP_STATUS_FSFREQ_ERROR | | 1770 | req->status |= ZFCP_STATUS_FSFREQ_ERROR | |
1773 | ZFCP_STATUS_FSFREQ_RETRY; | 1771 | ZFCP_STATUS_FSFREQ_RETRY; |
@@ -1787,9 +1785,11 @@ static void zfcp_fsf_close_physical_port_handler(struct zfcp_fsf_req *req) | |||
1787 | * ZFCP_STATUS_COMMON_OPEN must not be reset for the port | 1785 | * ZFCP_STATUS_COMMON_OPEN must not be reset for the port |
1788 | */ | 1786 | */ |
1789 | atomic_clear_mask(ZFCP_STATUS_PORT_PHYS_OPEN, &port->status); | 1787 | atomic_clear_mask(ZFCP_STATUS_PORT_PHYS_OPEN, &port->status); |
1790 | list_for_each_entry(unit, &port->unit_list_head, list) | 1788 | read_lock(&port->unit_list_lock); |
1789 | list_for_each_entry(unit, &port->unit_list, list) | ||
1791 | atomic_clear_mask(ZFCP_STATUS_COMMON_OPEN, | 1790 | atomic_clear_mask(ZFCP_STATUS_COMMON_OPEN, |
1792 | &unit->status); | 1791 | &unit->status); |
1792 | read_unlock(&port->unit_list_lock); | ||
1793 | break; | 1793 | break; |
1794 | } | 1794 | } |
1795 | } | 1795 | } |