Commit 3111b0d1 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by James Bottomley

[SCSI] remove scsi_eh_eflags_ macros

Just opencoded access to eh_eflags, it's much more readable anyway.
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 8d115f84
...@@ -2864,7 +2864,7 @@ static void ata_qc_timeout(struct ata_queued_cmd *qc) ...@@ -2864,7 +2864,7 @@ static void ata_qc_timeout(struct ata_queued_cmd *qc)
if (qc->dev->class == ATA_DEV_ATAPI && qc->scsicmd) { if (qc->dev->class == ATA_DEV_ATAPI && qc->scsicmd) {
struct scsi_cmnd *cmd = qc->scsicmd; struct scsi_cmnd *cmd = qc->scsicmd;
if (!scsi_eh_eflags_chk(cmd, SCSI_EH_CANCEL_CMD)) { if (!(cmd->eh_eflags & SCSI_EH_CANCEL_CMD)) {
/* finish completing original command */ /* finish completing original command */
__ata_qc_complete(qc); __ata_qc_complete(qc);
......
...@@ -73,7 +73,7 @@ int scsi_eh_scmd_add(struct scsi_cmnd *scmd, int eh_flag) ...@@ -73,7 +73,7 @@ int scsi_eh_scmd_add(struct scsi_cmnd *scmd, int eh_flag)
spin_lock_irqsave(shost->host_lock, flags); spin_lock_irqsave(shost->host_lock, flags);
scsi_eh_eflags_set(scmd, eh_flag); scmd->eh_eflags |= eh_flag;
list_add_tail(&scmd->eh_entry, &shost->eh_cmd_q); list_add_tail(&scmd->eh_entry, &shost->eh_cmd_q);
set_bit(SHOST_RECOVERY, &shost->shost_state); set_bit(SHOST_RECOVERY, &shost->shost_state);
shost->host_failed++; shost->host_failed++;
...@@ -228,8 +228,7 @@ static inline void scsi_eh_prt_fail_stats(struct Scsi_Host *shost, ...@@ -228,8 +228,7 @@ static inline void scsi_eh_prt_fail_stats(struct Scsi_Host *shost,
list_for_each_entry(scmd, work_q, eh_entry) { list_for_each_entry(scmd, work_q, eh_entry) {
if (scmd->device == sdev) { if (scmd->device == sdev) {
++total_failures; ++total_failures;
if (scsi_eh_eflags_chk(scmd, if (scmd->eh_eflags & SCSI_EH_CANCEL_CMD)
SCSI_EH_CANCEL_CMD))
++cmd_cancel; ++cmd_cancel;
else else
++cmd_failed; ++cmd_failed;
...@@ -425,7 +424,7 @@ static int scsi_eh_completed_normally(struct scsi_cmnd *scmd) ...@@ -425,7 +424,7 @@ static int scsi_eh_completed_normally(struct scsi_cmnd *scmd)
**/ **/
static void scsi_eh_times_out(struct scsi_cmnd *scmd) static void scsi_eh_times_out(struct scsi_cmnd *scmd)
{ {
scsi_eh_eflags_set(scmd, SCSI_EH_REC_TIMEOUT); scmd->eh_eflags |= SCSI_EH_REC_TIMEOUT;
SCSI_LOG_ERROR_RECOVERY(3, printk("%s: scmd:%p\n", __FUNCTION__, SCSI_LOG_ERROR_RECOVERY(3, printk("%s: scmd:%p\n", __FUNCTION__,
scmd)); scmd));
...@@ -504,8 +503,8 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, int timeout) ...@@ -504,8 +503,8 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, int timeout)
* see if timeout. if so, tell the host to forget about it. * see if timeout. if so, tell the host to forget about it.
* in other words, we don't want a callback any more. * in other words, we don't want a callback any more.
*/ */
if (scsi_eh_eflags_chk(scmd, SCSI_EH_REC_TIMEOUT)) { if (scmd->eh_eflags & SCSI_EH_REC_TIMEOUT) {
scsi_eh_eflags_clr(scmd, SCSI_EH_REC_TIMEOUT); scmd->eh_eflags &= ~SCSI_EH_REC_TIMEOUT;
/* /*
* as far as the low level driver is * as far as the low level driver is
...@@ -630,7 +629,7 @@ static void scsi_eh_finish_cmd(struct scsi_cmnd *scmd, ...@@ -630,7 +629,7 @@ static void scsi_eh_finish_cmd(struct scsi_cmnd *scmd,
struct list_head *done_q) struct list_head *done_q)
{ {
scmd->device->host->host_failed--; scmd->device->host->host_failed--;
scsi_eh_eflags_clr_all(scmd); scmd->eh_eflags = 0;
/* /*
* set this back so that the upper level can correctly free up * 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,7 +668,7 @@ static int scsi_eh_get_sense(struct list_head *work_q,
list_for_each_safe(lh, lh_sf, work_q) { list_for_each_safe(lh, lh_sf, work_q) {
scmd = list_entry(lh, struct scsi_cmnd, eh_entry); scmd = list_entry(lh, struct scsi_cmnd, eh_entry);
if (scsi_eh_eflags_chk(scmd, SCSI_EH_CANCEL_CMD) || if ((scmd->eh_eflags & SCSI_EH_CANCEL_CMD) ||
SCSI_SENSE_VALID(scmd)) SCSI_SENSE_VALID(scmd))
continue; continue;
...@@ -805,14 +804,14 @@ static int scsi_eh_abort_cmds(struct list_head *work_q, ...@@ -805,14 +804,14 @@ static int scsi_eh_abort_cmds(struct list_head *work_q,
list_for_each_safe(lh, lh_sf, work_q) { list_for_each_safe(lh, lh_sf, work_q) {
scmd = list_entry(lh, struct scsi_cmnd, eh_entry); scmd = list_entry(lh, struct scsi_cmnd, eh_entry);
if (!scsi_eh_eflags_chk(scmd, SCSI_EH_CANCEL_CMD)) if (!(scmd->eh_eflags & SCSI_EH_CANCEL_CMD))
continue; continue;
SCSI_LOG_ERROR_RECOVERY(3, printk("%s: aborting cmd:" SCSI_LOG_ERROR_RECOVERY(3, printk("%s: aborting cmd:"
"0x%p\n", current->comm, "0x%p\n", current->comm,
scmd)); scmd));
rtn = scsi_try_to_abort_cmd(scmd); rtn = scsi_try_to_abort_cmd(scmd);
if (rtn == SUCCESS) { if (rtn == SUCCESS) {
scsi_eh_eflags_clr(scmd, SCSI_EH_CANCEL_CMD); scmd->eh_eflags &= ~SCSI_EH_CANCEL_CMD;
if (!scsi_device_online(scmd->device) || if (!scsi_device_online(scmd->device) ||
!scsi_eh_tur(scmd)) { !scsi_eh_tur(scmd)) {
scsi_eh_finish_cmd(scmd, done_q); scsi_eh_finish_cmd(scmd, done_q);
...@@ -1194,7 +1193,7 @@ static void scsi_eh_offline_sdevs(struct list_head *work_q, ...@@ -1194,7 +1193,7 @@ static void scsi_eh_offline_sdevs(struct list_head *work_q,
scmd->device->id, scmd->device->id,
scmd->device->lun); scmd->device->lun);
scsi_device_set_state(scmd->device, SDEV_OFFLINE); scsi_device_set_state(scmd->device, SDEV_OFFLINE);
if (scsi_eh_eflags_chk(scmd, SCSI_EH_CANCEL_CMD)) { if (scmd->eh_eflags & SCSI_EH_CANCEL_CMD) {
/* /*
* FIXME: Handle lost cmds. * FIXME: Handle lost cmds.
*/ */
......
...@@ -21,15 +21,6 @@ struct Scsi_Host; ...@@ -21,15 +21,6 @@ struct Scsi_Host;
/* /*
* Scsi Error Handler Flags * Scsi Error Handler Flags
*/ */
#define scsi_eh_eflags_chk(scp, flags) \
((scp)->eh_eflags & (flags))
#define scsi_eh_eflags_set(scp, flags) \
do { (scp)->eh_eflags |= (flags); } while(0)
#define scsi_eh_eflags_clr(scp, flags) \
do { (scp)->eh_eflags &= ~(flags); } while(0)
#define scsi_eh_eflags_clr_all(scp) \
(scp->eh_eflags = 0)
#define SCSI_EH_CANCEL_CMD 0x0001 /* Cancel this cmd */ #define SCSI_EH_CANCEL_CMD 0x0001 /* Cancel this cmd */
#define SCSI_EH_REC_TIMEOUT 0x0002 /* EH retry timed out */ #define SCSI_EH_REC_TIMEOUT 0x0002 /* EH retry timed out */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment