[PATCH] libata: add ATA_QCFLAG_EH_SCHEDULED
Add ATA_QCFLAG_EH_SCHEDULED. If this flag is set, the qc is owned by EH and normal completion path is not allowed to finish it. This patch doesn't actually use this flag. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
This commit is contained in:
@@ -3620,19 +3620,7 @@ void ata_qc_free(struct ata_queued_cmd *qc)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
inline void __ata_qc_complete(struct ata_queued_cmd *qc)
|
||||||
* ata_qc_complete - Complete an active ATA command
|
|
||||||
* @qc: Command to complete
|
|
||||||
* @err_mask: ATA Status register contents
|
|
||||||
*
|
|
||||||
* Indicate to the mid and upper layers that an ATA
|
|
||||||
* command has completed, with either an ok or not-ok status.
|
|
||||||
*
|
|
||||||
* LOCKING:
|
|
||||||
* spin_lock_irqsave(host_set lock)
|
|
||||||
*/
|
|
||||||
|
|
||||||
void ata_qc_complete(struct ata_queued_cmd *qc)
|
|
||||||
{
|
{
|
||||||
assert(qc != NULL); /* ata_qc_from_tag _might_ return NULL */
|
assert(qc != NULL); /* ata_qc_from_tag _might_ return NULL */
|
||||||
assert(qc->flags & ATA_QCFLAG_ACTIVE);
|
assert(qc->flags & ATA_QCFLAG_ACTIVE);
|
||||||
@@ -3650,6 +3638,25 @@ void ata_qc_complete(struct ata_queued_cmd *qc)
|
|||||||
qc->complete_fn(qc);
|
qc->complete_fn(qc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ata_qc_complete - Complete an active ATA command
|
||||||
|
* @qc: Command to complete
|
||||||
|
* @err_mask: ATA Status register contents
|
||||||
|
*
|
||||||
|
* Indicate to the mid and upper layers that an ATA
|
||||||
|
* command has completed, with either an ok or not-ok status.
|
||||||
|
*
|
||||||
|
* LOCKING:
|
||||||
|
* spin_lock_irqsave(host_set lock)
|
||||||
|
*/
|
||||||
|
void ata_qc_complete(struct ata_queued_cmd *qc)
|
||||||
|
{
|
||||||
|
if (unlikely(qc->flags & ATA_QCFLAG_EH_SCHEDULED))
|
||||||
|
return;
|
||||||
|
|
||||||
|
__ata_qc_complete(qc);
|
||||||
|
}
|
||||||
|
|
||||||
static inline int ata_should_dma_map(struct ata_queued_cmd *qc)
|
static inline int ata_should_dma_map(struct ata_queued_cmd *qc)
|
||||||
{
|
{
|
||||||
struct ata_port *ap = qc->ap;
|
struct ata_port *ap = qc->ap;
|
||||||
|
@@ -770,7 +770,7 @@ static void __ata_eh_qc_complete(struct ata_queued_cmd *qc)
|
|||||||
|
|
||||||
spin_lock_irqsave(&ap->host_set->lock, flags);
|
spin_lock_irqsave(&ap->host_set->lock, flags);
|
||||||
qc->scsidone = ata_eh_scsidone;
|
qc->scsidone = ata_eh_scsidone;
|
||||||
ata_qc_complete(qc);
|
__ata_qc_complete(qc);
|
||||||
assert(!ata_tag_valid(qc->tag));
|
assert(!ata_tag_valid(qc->tag));
|
||||||
spin_unlock_irqrestore(&ap->host_set->lock, flags);
|
spin_unlock_irqrestore(&ap->host_set->lock, flags);
|
||||||
|
|
||||||
|
@@ -46,6 +46,7 @@ extern struct ata_queued_cmd *ata_qc_new_init(struct ata_port *ap,
|
|||||||
extern int ata_rwcmd_protocol(struct ata_queued_cmd *qc);
|
extern int ata_rwcmd_protocol(struct ata_queued_cmd *qc);
|
||||||
extern void ata_qc_free(struct ata_queued_cmd *qc);
|
extern void ata_qc_free(struct ata_queued_cmd *qc);
|
||||||
extern unsigned int ata_qc_issue(struct ata_queued_cmd *qc);
|
extern unsigned int ata_qc_issue(struct ata_queued_cmd *qc);
|
||||||
|
extern void __ata_qc_complete(struct ata_queued_cmd *qc);
|
||||||
extern int ata_check_atapi_dma(struct ata_queued_cmd *qc);
|
extern int ata_check_atapi_dma(struct ata_queued_cmd *qc);
|
||||||
extern void ata_dev_select(struct ata_port *ap, unsigned int device,
|
extern void ata_dev_select(struct ata_port *ap, unsigned int device,
|
||||||
unsigned int wait, unsigned int can_sleep);
|
unsigned int wait, unsigned int can_sleep);
|
||||||
|
@@ -169,6 +169,7 @@ enum {
|
|||||||
ATA_QCFLAG_SG = (1 << 3), /* have s/g table? */
|
ATA_QCFLAG_SG = (1 << 3), /* have s/g table? */
|
||||||
ATA_QCFLAG_SINGLE = (1 << 4), /* no s/g, just a single buffer */
|
ATA_QCFLAG_SINGLE = (1 << 4), /* no s/g, just a single buffer */
|
||||||
ATA_QCFLAG_DMAMAP = ATA_QCFLAG_SG | ATA_QCFLAG_SINGLE,
|
ATA_QCFLAG_DMAMAP = ATA_QCFLAG_SG | ATA_QCFLAG_SINGLE,
|
||||||
|
ATA_QCFLAG_EH_SCHEDULED = (1 << 5), /* EH scheduled */
|
||||||
|
|
||||||
/* various lengths of time */
|
/* various lengths of time */
|
||||||
ATA_TMOUT_EDD = 5 * HZ, /* heuristic */
|
ATA_TMOUT_EDD = 5 * HZ, /* heuristic */
|
||||||
|
Reference in New Issue
Block a user