aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata-core.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2006-11-22 09:54:01 -0500
committerDavid Howells <dhowells@redhat.com>2006-11-22 09:54:01 -0500
commit52bad64d95bd89e08c49ec5a071fa6dcbe5a1a9c (patch)
tree5849b4e3c17daa70a7e81cfdeaddac9ac8a0e953 /drivers/ata/libata-core.c
parent0f9005a6f7a82f4aacbd72f7b92322a8ca1c3f97 (diff)
WorkStruct: Separate delayable and non-delayable events.
Separate delayable work items from non-delayable work items be splitting them into a separate structure (delayed_work), which incorporates a work_struct and the timer_list removed from work_struct. The work_struct struct is huge, and this limits it's usefulness. On a 64-bit architecture it's nearly 100 bytes in size. This reduces that by half for the non-delayable type of event. Signed-Off-By: David Howells <dhowells@redhat.com>
Diffstat (limited to 'drivers/ata/libata-core.c')
-rw-r--r--drivers/ata/libata-core.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 915a55a6cc14..0bb4b4dced76 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -937,12 +937,9 @@ void ata_port_queue_task(struct ata_port *ap, void (*fn)(void *), void *data,
937 if (ap->pflags & ATA_PFLAG_FLUSH_PORT_TASK) 937 if (ap->pflags & ATA_PFLAG_FLUSH_PORT_TASK)
938 return; 938 return;
939 939
940 PREPARE_WORK(&ap->port_task, fn, data); 940 PREPARE_DELAYED_WORK(&ap->port_task, fn, data);
941 941
942 if (!delay) 942 rc = queue_delayed_work(ata_wq, &ap->port_task, delay);
943 rc = queue_work(ata_wq, &ap->port_task);
944 else
945 rc = queue_delayed_work(ata_wq, &ap->port_task, delay);
946 943
947 /* rc == 0 means that another user is using port task */ 944 /* rc == 0 means that another user is using port task */
948 WARN_ON(rc == 0); 945 WARN_ON(rc == 0);
@@ -5320,8 +5317,8 @@ void ata_port_init(struct ata_port *ap, struct ata_host *host,
5320 ap->msg_enable = ATA_MSG_DRV | ATA_MSG_ERR | ATA_MSG_WARN; 5317 ap->msg_enable = ATA_MSG_DRV | ATA_MSG_ERR | ATA_MSG_WARN;
5321#endif 5318#endif
5322 5319
5323 INIT_WORK(&ap->port_task, NULL, NULL); 5320 INIT_DELAYED_WORK(&ap->port_task, NULL, NULL);
5324 INIT_WORK(&ap->hotplug_task, ata_scsi_hotplug, ap); 5321 INIT_DELAYED_WORK(&ap->hotplug_task, ata_scsi_hotplug, ap);
5325 INIT_WORK(&ap->scsi_rescan_task, ata_scsi_dev_rescan, ap); 5322 INIT_WORK(&ap->scsi_rescan_task, ata_scsi_dev_rescan, ap);
5326 INIT_LIST_HEAD(&ap->eh_done_q); 5323 INIT_LIST_HEAD(&ap->eh_done_q);
5327 init_waitqueue_head(&ap->eh_wait_q); 5324 init_waitqueue_head(&ap->eh_wait_q);