]> nv-tegra.nvidia Code Review - linux-2.6.git/commitdiff
[PATCH] libata: create pio/atapi task queueing wrappers
authorTejun Heo <htejun@gmail.com>
Mon, 23 Jan 2006 04:09:37 +0000 (13:09 +0900)
committerJeff Garzik <jgarzik@pobox.com>
Fri, 27 Jan 2006 04:01:29 +0000 (23:01 -0500)
Wrap pio/atapi task queueing in correspondingly named functions.  This
change doesn't change anything.  It's preparation for follow-up
pio-task/eh sync patch.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
drivers/scsi/libata-core.c

index 93ae2dcc837c183c41f367ad3c1c9d8688a169d6..71de697e2327ec64c8c5e513e9c577cea1cca023 100644 (file)
@@ -1072,6 +1072,24 @@ static unsigned int ata_pio_modes(const struct ata_device *adev)
           timing API will get this right anyway */
 }
 
+static inline void
+ata_queue_packet_task(struct ata_port *ap)
+{
+       queue_work(ata_wq, &ap->packet_task);
+}
+
+static inline void
+ata_queue_pio_task(struct ata_port *ap)
+{
+       queue_work(ata_wq, &ap->pio_task);
+}
+
+static inline void
+ata_queue_delayed_pio_task(struct ata_port *ap, unsigned long delay)
+{
+       queue_delayed_work(ata_wq, &ap->pio_task, delay);
+}
+
 void ata_qc_complete_internal(struct ata_queued_cmd *qc)
 {
        struct completion *waiting = qc->private_data;
@@ -3414,7 +3432,7 @@ fsm_start:
        }
 
        if (timeout)
-               queue_delayed_work(ata_wq, &ap->pio_task, timeout);
+               ata_queue_delayed_pio_task(ap, timeout);
        else if (!qc_completed)
                goto fsm_start;
 }
@@ -3737,26 +3755,26 @@ unsigned int ata_qc_issue_prot(struct ata_queued_cmd *qc)
                ata_qc_set_polling(qc);
                ata_tf_to_host(ap, &qc->tf);
                ap->hsm_task_state = HSM_ST;
-               queue_work(ata_wq, &ap->pio_task);
+               ata_queue_pio_task(ap);
                break;
 
        case ATA_PROT_ATAPI:
                ata_qc_set_polling(qc);
                ata_tf_to_host(ap, &qc->tf);
-               queue_work(ata_wq, &ap->packet_task);
+               ata_queue_packet_task(ap);
                break;
 
        case ATA_PROT_ATAPI_NODATA:
                ap->flags |= ATA_FLAG_NOINTR;
                ata_tf_to_host(ap, &qc->tf);
-               queue_work(ata_wq, &ap->packet_task);
+               ata_queue_packet_task(ap);
                break;
 
        case ATA_PROT_ATAPI_DMA:
                ap->flags |= ATA_FLAG_NOINTR;
                ap->ops->tf_load(ap, &qc->tf);   /* load tf registers */
                ap->ops->bmdma_setup(qc);           /* set up bmdma */
-               queue_work(ata_wq, &ap->packet_task);
+               ata_queue_packet_task(ap);
                break;
 
        default:
@@ -4187,7 +4205,7 @@ static void atapi_packet_task(void *_data)
 
                /* PIO commands are handled by polling */
                ap->hsm_task_state = HSM_ST;
-               queue_work(ata_wq, &ap->pio_task);
+               ata_queue_pio_task(ap);
        }
 
        return;