diff options
author | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-01-20 10:28:24 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-01-23 12:37:44 -0500 |
commit | 5b7f16804ad90e7f7a10c05b6a2e782598d9745a (patch) | |
tree | 2228c575b0b001eaf76f48216fee2f066065681a /drivers/scsi/hosts.c | |
parent | de25deb18016f66dcdede165d07654559bb332bc (diff) |
[SCSI] don't use __GFP_DMA for sense buffers if not required
Only hosts which actually have ISA DMA requirements need sense buffers
coming out of ZONE_DMA, so only use the __GFP_DMA flag for that case
to avoid allocating this scarce resource if it's not necessary.
[tomo: fixed slab leak in failure case]
Acked-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/hosts.c')
-rw-r--r-- | drivers/scsi/hosts.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c index f5d3fbb55717..9a10b4335e76 100644 --- a/drivers/scsi/hosts.c +++ b/drivers/scsi/hosts.c | |||
@@ -268,7 +268,6 @@ static void scsi_host_dev_release(struct device *dev) | |||
268 | } | 268 | } |
269 | 269 | ||
270 | scsi_destroy_command_freelist(shost); | 270 | scsi_destroy_command_freelist(shost); |
271 | scsi_destroy_command_sense_buffer(shost); | ||
272 | if (shost->bqt) | 271 | if (shost->bqt) |
273 | blk_free_tags(shost->bqt); | 272 | blk_free_tags(shost->bqt); |
274 | 273 | ||
@@ -373,13 +372,9 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize) | |||
373 | else | 372 | else |
374 | shost->dma_boundary = 0xffffffff; | 373 | shost->dma_boundary = 0xffffffff; |
375 | 374 | ||
376 | rval = scsi_setup_command_sense_buffer(shost); | ||
377 | if (rval) | ||
378 | goto fail_kfree; | ||
379 | |||
380 | rval = scsi_setup_command_freelist(shost); | 375 | rval = scsi_setup_command_freelist(shost); |
381 | if (rval) | 376 | if (rval) |
382 | goto fail_destroy_sense; | 377 | goto fail_kfree; |
383 | 378 | ||
384 | device_initialize(&shost->shost_gendev); | 379 | device_initialize(&shost->shost_gendev); |
385 | snprintf(shost->shost_gendev.bus_id, BUS_ID_SIZE, "host%d", | 380 | snprintf(shost->shost_gendev.bus_id, BUS_ID_SIZE, "host%d", |
@@ -404,8 +399,6 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize) | |||
404 | 399 | ||
405 | fail_destroy_freelist: | 400 | fail_destroy_freelist: |
406 | scsi_destroy_command_freelist(shost); | 401 | scsi_destroy_command_freelist(shost); |
407 | fail_destroy_sense: | ||
408 | scsi_destroy_command_sense_buffer(shost); | ||
409 | fail_kfree: | 402 | fail_kfree: |
410 | kfree(shost); | 403 | kfree(shost); |
411 | return NULL; | 404 | return NULL; |