summaryrefslogtreecommitdiffstats
path: root/sys/dev/ata/atapi-cd.c
diff options
context:
space:
mode:
authorsos <sos@FreeBSD.org>2008-04-17 12:29:35 +0000
committersos <sos@FreeBSD.org>2008-04-17 12:29:35 +0000
commitb11f9dd52aac5645107b2d8cb24361e9495b17d6 (patch)
treeb12f34c4c9498ff9f554b3fab04f8ac66236b802 /sys/dev/ata/atapi-cd.c
parent3f4fde5950af141f4f874f9172842398de81e11d (diff)
downloadFreeBSD-src-b11f9dd52aac5645107b2d8cb24361e9495b17d6.zip
FreeBSD-src-b11f9dd52aac5645107b2d8cb24361e9495b17d6.tar.gz
Go back to preallocating everything possible on init.
This avoids calling busdma in the request processing path which caused a traumatic performance degradation. Allocation has be postponed to after we know how many devices we possible can have on portmulitpliers to save some space.
Diffstat (limited to 'sys/dev/ata/atapi-cd.c')
-rw-r--r--sys/dev/ata/atapi-cd.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/dev/ata/atapi-cd.c b/sys/dev/ata/atapi-cd.c
index f9fcf97..7bf3b9f 100644
--- a/sys/dev/ata/atapi-cd.c
+++ b/sys/dev/ata/atapi-cd.c
@@ -691,11 +691,12 @@ acd_geom_access(struct g_provider *pp, int dr, int dw, int de)
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
int timeout = 60, track;
- if (!(request = ata_alloc_request(dev)))
+ if (!(request = ata_alloc_request()))
return ENOMEM;
/* wait if drive is not finished loading the medium */
while (timeout--) {
+ request->dev = dev;
bcopy(ccb, request->u.atapi.ccb, 16);
request->flags = ATA_R_ATAPI;
request->timeout = 5;
@@ -855,10 +856,11 @@ acd_strategy(struct bio *bp)
ccb[7] = count>>8;
ccb[8] = count;
- if (!(request = ata_alloc_request(dev))) {
+ if (!(request = ata_alloc_request())) {
g_io_deliver(bp, ENOMEM);
return;
}
+ request->dev = dev;
request->bio = bp;
bcopy(ccb, request->u.atapi.ccb,
(atadev->param.config & ATA_PROTO_MASK) ==
@@ -1218,9 +1220,10 @@ acd_get_progress(device_t dev, int *finished)
struct ata_request *request;
int8_t dummy[8];
- if (!(request = ata_alloc_request(dev)))
+ if (!(request = ata_alloc_request()))
return ENOMEM;
+ request->dev = dev;
bcopy(ccb, request->u.atapi.ccb, 16);
request->data = dummy;
request->bytecount = sizeof(dummy);
OpenPOWER on IntegriCloud