diff options
author | Tejun Heo <htejun@gmail.com> | 2006-02-10 15:10:48 +0900 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2006-02-10 06:50:45 -0500 |
commit | 341963b909a01d2f38d86f5db8dd1f8c80bd6dbf (patch) | |
tree | b19def143135b45b64d62e4e048aaae5b711696f /drivers/scsi/libata-core.c | |
parent | 1fdffbce0332b3e00993d741e76935e7f4f0d40f (diff) | |
download | op-kernel-dev-341963b909a01d2f38d86f5db8dd1f8c80bd6dbf.zip op-kernel-dev-341963b909a01d2f38d86f5db8dd1f8c80bd6dbf.tar.gz |
[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>
Diffstat (limited to 'drivers/scsi/libata-core.c')
-rw-r--r-- | drivers/scsi/libata-core.c | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c index 22db739..977a53d 100644 --- a/drivers/scsi/libata-core.c +++ b/drivers/scsi/libata-core.c @@ -3620,19 +3620,7 @@ void ata_qc_free(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) +inline void __ata_qc_complete(struct ata_queued_cmd *qc) { assert(qc != NULL); /* ata_qc_from_tag _might_ return NULL */ assert(qc->flags & ATA_QCFLAG_ACTIVE); @@ -3650,6 +3638,25 @@ void ata_qc_complete(struct ata_queued_cmd *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) { struct ata_port *ap = qc->ap; |