Commit af181c2d authored by Tejun Heo's avatar Tejun Heo Committed by Jeff Garzik

[PATCH] libata: move ata_eh_clear_action() upward

Move ata_eh_clear_action() upward.
Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent 41542dbe
...@@ -93,6 +93,31 @@ static int ata_ering_map(struct ata_ering *ering, ...@@ -93,6 +93,31 @@ static int ata_ering_map(struct ata_ering *ering,
return rc; return rc;
} }
static void ata_eh_clear_action(struct ata_device *dev,
struct ata_eh_info *ehi, unsigned int action)
{
int i;
if (!dev) {
ehi->action &= ~action;
for (i = 0; i < ATA_MAX_DEVICES; i++)
ehi->dev_action[i] &= ~action;
} else {
/* doesn't make sense for port-wide EH actions */
WARN_ON(!(action & ATA_EH_PERDEV_MASK));
/* break ehi->action into ehi->dev_action */
if (ehi->action & action) {
for (i = 0; i < ATA_MAX_DEVICES; i++)
ehi->dev_action[i] |= ehi->action & action;
ehi->action &= ~action;
}
/* turn off the specified per-dev action */
ehi->dev_action[dev->devno] &= ~action;
}
}
/** /**
* ata_scsi_timed_out - SCSI layer time out callback * ata_scsi_timed_out - SCSI layer time out callback
* @cmd: timed out SCSI command * @cmd: timed out SCSI command
...@@ -705,31 +730,6 @@ static void ata_eh_detach_dev(struct ata_device *dev) ...@@ -705,31 +730,6 @@ static void ata_eh_detach_dev(struct ata_device *dev)
spin_unlock_irqrestore(ap->lock, flags); spin_unlock_irqrestore(ap->lock, flags);
} }
static void ata_eh_clear_action(struct ata_device *dev,
struct ata_eh_info *ehi, unsigned int action)
{
int i;
if (!dev) {
ehi->action &= ~action;
for (i = 0; i < ATA_MAX_DEVICES; i++)
ehi->dev_action[i] &= ~action;
} else {
/* doesn't make sense for port-wide EH actions */
WARN_ON(!(action & ATA_EH_PERDEV_MASK));
/* break ehi->action into ehi->dev_action */
if (ehi->action & action) {
for (i = 0; i < ATA_MAX_DEVICES; i++)
ehi->dev_action[i] |= ehi->action & action;
ehi->action &= ~action;
}
/* turn off the specified per-dev action */
ehi->dev_action[dev->devno] &= ~action;
}
}
/** /**
* ata_eh_about_to_do - about to perform eh_action * ata_eh_about_to_do - about to perform eh_action
* @ap: target ATA port * @ap: target ATA port
......
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