diff options
author | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-01-20 09:28:24 -0600 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-01-23 11:37:44 -0600 |
commit | 5b7f16804ad90e7f7a10c05b6a2e782598d9745a (patch) | |
tree | 2228c575b0b001eaf76f48216fee2f066065681a /drivers/scsi/hosts.c | |
parent | de25deb18016f66dcdede165d07654559bb332bc (diff) | |
download | linux-5b7f16804ad90e7f7a10c05b6a2e782598d9745a.tar.gz linux-5b7f16804ad90e7f7a10c05b6a2e782598d9745a.tar.bz2 linux-5b7f16804ad90e7f7a10c05b6a2e782598d9745a.zip |
[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) } scsi_destroy_command_freelist(shost); - scsi_destroy_command_sense_buffer(shost); if (shost->bqt) blk_free_tags(shost->bqt); @@ -373,13 +372,9 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize) else shost->dma_boundary = 0xffffffff; - rval = scsi_setup_command_sense_buffer(shost); - if (rval) - goto fail_kfree; - rval = scsi_setup_command_freelist(shost); if (rval) - goto fail_destroy_sense; + goto fail_kfree; device_initialize(&shost->shost_gendev); 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) fail_destroy_freelist: scsi_destroy_command_freelist(shost); - fail_destroy_sense: - scsi_destroy_command_sense_buffer(shost); fail_kfree: kfree(shost); return NULL; |