Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 204167
b: refs/heads/master
c: 1117ef8
h: refs/heads/master
i:
  204165: d7c867a
  204163: 2e80f58
  204159: 7a82e16
v: v3
  • Loading branch information
Brian King authored and James Bottomley committed Jul 27, 2010
1 parent 866d11d commit b5a2455
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0f33ece5bc3d5a9567b65cfbc736e8f206ecfc7b
refs/heads/master: 1117ef8aed95521f46dae3052c7120baae48c2bb
31 changes: 17 additions & 14 deletions trunk/drivers/scsi/ibmvscsi/ibmvscsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -474,23 +474,26 @@ static int map_data_for_srp_cmd(struct scsi_cmnd *cmd,
*/
static void purge_requests(struct ibmvscsi_host_data *hostdata, int error_code)
{
struct srp_event_struct *tmp_evt, *pos;
struct srp_event_struct *evt;
unsigned long flags;

spin_lock_irqsave(hostdata->host->host_lock, flags);
list_for_each_entry_safe(tmp_evt, pos, &hostdata->sent, list) {
list_del(&tmp_evt->list);
del_timer(&tmp_evt->timer);
if (tmp_evt->cmnd) {
tmp_evt->cmnd->result = (error_code << 16);
unmap_cmd_data(&tmp_evt->iu.srp.cmd,
tmp_evt,
tmp_evt->hostdata->dev);
if (tmp_evt->cmnd_done)
tmp_evt->cmnd_done(tmp_evt->cmnd);
} else if (tmp_evt->done)
tmp_evt->done(tmp_evt);
free_event_struct(&tmp_evt->hostdata->pool, tmp_evt);
while (!list_empty(&hostdata->sent)) {
evt = list_first_entry(&hostdata->sent, struct srp_event_struct, list);
list_del(&evt->list);
del_timer(&evt->timer);

spin_unlock_irqrestore(hostdata->host->host_lock, flags);
if (evt->cmnd) {
evt->cmnd->result = (error_code << 16);
unmap_cmd_data(&evt->iu.srp.cmd, evt,
evt->hostdata->dev);
if (evt->cmnd_done)
evt->cmnd_done(evt->cmnd);
} else if (evt->done)
evt->done(evt);
free_event_struct(&evt->hostdata->pool, evt);
spin_lock_irqsave(hostdata->host->host_lock, flags);
}
spin_unlock_irqrestore(hostdata->host->host_lock, flags);
}
Expand Down

0 comments on commit b5a2455

Please sign in to comment.