diff options
author | Christoph Hellwig <hch@lst.de> | 2005-06-19 07:43:26 -0400 |
---|---|---|
committer | James Bottomley <jejb@titanic.(none)> | 2005-06-26 13:17:24 -0400 |
commit | 3111b0d1646b3e1891dc08112d087aed2146fafe (patch) | |
tree | 63c0e61dfc184ae6e567f94f1c95dbd517879ed3 /drivers | |
parent | 8d115f845a0bd59cd263e791f739964f42b7b0e8 (diff) |
[SCSI] remove scsi_eh_eflags_ macros
Just opencoded access to eh_eflags, it's much more readable anyway.
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/scsi/libata-core.c | 2 | ||||
-rw-r--r-- | drivers/scsi/scsi_error.c | 21 | ||||
-rw-r--r-- | drivers/scsi/scsi_priv.h | 9 |
3 files changed, 11 insertions, 21 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c index a974dc8984b4..fe1c72981f5a 100644 --- a/drivers/scsi/libata-core.c +++ b/drivers/scsi/libata-core.c | |||
@@ -2864,7 +2864,7 @@ static void ata_qc_timeout(struct ata_queued_cmd *qc) | |||
2864 | if (qc->dev->class == ATA_DEV_ATAPI && qc->scsicmd) { | 2864 | if (qc->dev->class == ATA_DEV_ATAPI && qc->scsicmd) { |
2865 | struct scsi_cmnd *cmd = qc->scsicmd; | 2865 | struct scsi_cmnd *cmd = qc->scsicmd; |
2866 | 2866 | ||
2867 | if (!scsi_eh_eflags_chk(cmd, SCSI_EH_CANCEL_CMD)) { | 2867 | if (!(cmd->eh_eflags & SCSI_EH_CANCEL_CMD)) { |
2868 | 2868 | ||
2869 | /* finish completing original command */ | 2869 | /* finish completing original command */ |
2870 | __ata_qc_complete(qc); | 2870 | __ata_qc_complete(qc); |
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index 4f312da021f1..e289b3238539 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c | |||
@@ -73,7 +73,7 @@ int scsi_eh_scmd_add(struct scsi_cmnd *scmd, int eh_flag) | |||
73 | 73 | ||
74 | spin_lock_irqsave(shost->host_lock, flags); | 74 | spin_lock_irqsave(shost->host_lock, flags); |
75 | 75 | ||
76 | scsi_eh_eflags_set(scmd, eh_flag); | 76 | scmd->eh_eflags |= eh_flag; |
77 | list_add_tail(&scmd->eh_entry, &shost->eh_cmd_q); | 77 | list_add_tail(&scmd->eh_entry, &shost->eh_cmd_q); |
78 | set_bit(SHOST_RECOVERY, &shost->shost_state); | 78 | set_bit(SHOST_RECOVERY, &shost->shost_state); |
79 | shost->host_failed++; | 79 | shost->host_failed++; |
@@ -228,8 +228,7 @@ static inline void scsi_eh_prt_fail_stats(struct Scsi_Host *shost, | |||
228 | list_for_each_entry(scmd, work_q, eh_entry) { | 228 | list_for_each_entry(scmd, work_q, eh_entry) { |
229 | if (scmd->device == sdev) { | 229 | if (scmd->device == sdev) { |
230 | ++total_failures; | 230 | ++total_failures; |
231 | if (scsi_eh_eflags_chk(scmd, | 231 | if (scmd->eh_eflags & SCSI_EH_CANCEL_CMD) |
232 | SCSI_EH_CANCEL_CMD)) | ||
233 | ++cmd_cancel; | 232 | ++cmd_cancel; |
234 | else | 233 | else |
235 | ++cmd_failed; | 234 | ++cmd_failed; |
@@ -425,7 +424,7 @@ static int scsi_eh_completed_normally(struct scsi_cmnd *scmd) | |||
425 | **/ | 424 | **/ |
426 | static void scsi_eh_times_out(struct scsi_cmnd *scmd) | 425 | static void scsi_eh_times_out(struct scsi_cmnd *scmd) |
427 | { | 426 | { |
428 | scsi_eh_eflags_set(scmd, SCSI_EH_REC_TIMEOUT); | 427 | scmd->eh_eflags |= SCSI_EH_REC_TIMEOUT; |
429 | SCSI_LOG_ERROR_RECOVERY(3, printk("%s: scmd:%p\n", __FUNCTION__, | 428 | SCSI_LOG_ERROR_RECOVERY(3, printk("%s: scmd:%p\n", __FUNCTION__, |
430 | scmd)); | 429 | scmd)); |
431 | 430 | ||
@@ -504,8 +503,8 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, int timeout) | |||
504 | * see if timeout. if so, tell the host to forget about it. | 503 | * see if timeout. if so, tell the host to forget about it. |
505 | * in other words, we don't want a callback any more. | 504 | * in other words, we don't want a callback any more. |
506 | */ | 505 | */ |
507 | if (scsi_eh_eflags_chk(scmd, SCSI_EH_REC_TIMEOUT)) { | 506 | if (scmd->eh_eflags & SCSI_EH_REC_TIMEOUT) { |
508 | scsi_eh_eflags_clr(scmd, SCSI_EH_REC_TIMEOUT); | 507 | scmd->eh_eflags &= ~SCSI_EH_REC_TIMEOUT; |
509 | 508 | ||
510 | /* | 509 | /* |
511 | * as far as the low level driver is | 510 | * as far as the low level driver is |
@@ -630,7 +629,7 @@ static void scsi_eh_finish_cmd(struct scsi_cmnd *scmd, | |||
630 | struct list_head *done_q) | 629 | struct list_head *done_q) |
631 | { | 630 | { |
632 | scmd->device->host->host_failed--; | 631 | scmd->device->host->host_failed--; |
633 | scsi_eh_eflags_clr_all(scmd); | 632 | scmd->eh_eflags = 0; |
634 | 633 | ||
635 | /* | 634 | /* |
636 | * set this back so that the upper level can correctly free up | 635 | * set this back so that the upper level can correctly free up |
@@ -669,7 +668,7 @@ static int scsi_eh_get_sense(struct list_head *work_q, | |||
669 | 668 | ||
670 | list_for_each_safe(lh, lh_sf, work_q) { | 669 | list_for_each_safe(lh, lh_sf, work_q) { |
671 | scmd = list_entry(lh, struct scsi_cmnd, eh_entry); | 670 | scmd = list_entry(lh, struct scsi_cmnd, eh_entry); |
672 | if (scsi_eh_eflags_chk(scmd, SCSI_EH_CANCEL_CMD) || | 671 | if ((scmd->eh_eflags & SCSI_EH_CANCEL_CMD) || |
673 | SCSI_SENSE_VALID(scmd)) | 672 | SCSI_SENSE_VALID(scmd)) |
674 | continue; | 673 | continue; |
675 | 674 | ||
@@ -805,14 +804,14 @@ static int scsi_eh_abort_cmds(struct list_head *work_q, | |||
805 | 804 | ||
806 | list_for_each_safe(lh, lh_sf, work_q) { | 805 | list_for_each_safe(lh, lh_sf, work_q) { |
807 | scmd = list_entry(lh, struct scsi_cmnd, eh_entry); | 806 | scmd = list_entry(lh, struct scsi_cmnd, eh_entry); |
808 | if (!scsi_eh_eflags_chk(scmd, SCSI_EH_CANCEL_CMD)) | 807 | if (!(scmd->eh_eflags & SCSI_EH_CANCEL_CMD)) |
809 | continue; | 808 | continue; |
810 | SCSI_LOG_ERROR_RECOVERY(3, printk("%s: aborting cmd:" | 809 | SCSI_LOG_ERROR_RECOVERY(3, printk("%s: aborting cmd:" |
811 | "0x%p\n", current->comm, | 810 | "0x%p\n", current->comm, |
812 | scmd)); | 811 | scmd)); |
813 | rtn = scsi_try_to_abort_cmd(scmd); | 812 | rtn = scsi_try_to_abort_cmd(scmd); |
814 | if (rtn == SUCCESS) { | 813 | if (rtn == SUCCESS) { |
815 | scsi_eh_eflags_clr(scmd, SCSI_EH_CANCEL_CMD); | 814 | scmd->eh_eflags &= ~SCSI_EH_CANCEL_CMD; |
816 | if (!scsi_device_online(scmd->device) || | 815 | if (!scsi_device_online(scmd->device) || |
817 | !scsi_eh_tur(scmd)) { | 816 | !scsi_eh_tur(scmd)) { |
818 | scsi_eh_finish_cmd(scmd, done_q); | 817 | scsi_eh_finish_cmd(scmd, done_q); |
@@ -1194,7 +1193,7 @@ static void scsi_eh_offline_sdevs(struct list_head *work_q, | |||
1194 | scmd->device->id, | 1193 | scmd->device->id, |
1195 | scmd->device->lun); | 1194 | scmd->device->lun); |
1196 | scsi_device_set_state(scmd->device, SDEV_OFFLINE); | 1195 | scsi_device_set_state(scmd->device, SDEV_OFFLINE); |
1197 | if (scsi_eh_eflags_chk(scmd, SCSI_EH_CANCEL_CMD)) { | 1196 | if (scmd->eh_eflags & SCSI_EH_CANCEL_CMD) { |
1198 | /* | 1197 | /* |
1199 | * FIXME: Handle lost cmds. | 1198 | * FIXME: Handle lost cmds. |
1200 | */ | 1199 | */ |
diff --git a/drivers/scsi/scsi_priv.h b/drivers/scsi/scsi_priv.h index e0f5b5d4582d..d30d7f4e63ec 100644 --- a/drivers/scsi/scsi_priv.h +++ b/drivers/scsi/scsi_priv.h | |||
@@ -21,15 +21,6 @@ struct Scsi_Host; | |||
21 | /* | 21 | /* |
22 | * Scsi Error Handler Flags | 22 | * Scsi Error Handler Flags |
23 | */ | 23 | */ |
24 | #define scsi_eh_eflags_chk(scp, flags) \ | ||
25 | ((scp)->eh_eflags & (flags)) | ||
26 | #define scsi_eh_eflags_set(scp, flags) \ | ||
27 | do { (scp)->eh_eflags |= (flags); } while(0) | ||
28 | #define scsi_eh_eflags_clr(scp, flags) \ | ||
29 | do { (scp)->eh_eflags &= ~(flags); } while(0) | ||
30 | #define scsi_eh_eflags_clr_all(scp) \ | ||
31 | (scp->eh_eflags = 0) | ||
32 | |||
33 | #define SCSI_EH_CANCEL_CMD 0x0001 /* Cancel this cmd */ | 24 | #define SCSI_EH_CANCEL_CMD 0x0001 /* Cancel this cmd */ |
34 | #define SCSI_EH_REC_TIMEOUT 0x0002 /* EH retry timed out */ | 25 | #define SCSI_EH_REC_TIMEOUT 0x0002 /* EH retry timed out */ |
35 | 26 | ||