Skip to content

Commit

Permalink
scsi: remove scsi_cmd_dma_pool
Browse files Browse the repository at this point in the history
There is no need for GFP_DMA allocations of the scsi_cmnd structures
themselves, all that might be DMAed to or from is the actual payload,
or the sense buffers.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Acked-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
  • Loading branch information
Christoph Hellwig authored and Jens Axboe committed Jan 27, 2017
1 parent 0a6ac4e commit eeff68c
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions drivers/scsi/scsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,17 +102,10 @@ struct scsi_host_cmd_pool {
struct kmem_cache *cmd_slab;
unsigned int users;
char *cmd_name;
unsigned int slab_flags;
};

static struct scsi_host_cmd_pool scsi_cmd_pool = {
.cmd_name = "scsi_cmd_cache",
.slab_flags = SLAB_HWCACHE_ALIGN,
};

static struct scsi_host_cmd_pool scsi_cmd_dma_pool = {
.cmd_name = "scsi_cmd_cache(DMA)",
.slab_flags = SLAB_HWCACHE_ALIGN|SLAB_CACHE_DMA,
};

static DEFINE_MUTEX(host_cmd_pool_mutex);
Expand Down Expand Up @@ -290,8 +283,6 @@ scsi_find_host_cmd_pool(struct Scsi_Host *shost)
{
if (shost->hostt->cmd_size)
return shost->hostt->cmd_pool;
if (shost->unchecked_isa_dma)
return &scsi_cmd_dma_pool;
return &scsi_cmd_pool;
}

Expand All @@ -318,10 +309,6 @@ scsi_alloc_host_cmd_pool(struct Scsi_Host *shost)
return NULL;
}

pool->slab_flags = SLAB_HWCACHE_ALIGN;
if (shost->unchecked_isa_dma)
pool->slab_flags |= SLAB_CACHE_DMA;

if (hostt->cmd_size)
hostt->cmd_pool = pool;

Expand Down Expand Up @@ -349,7 +336,7 @@ scsi_get_host_cmd_pool(struct Scsi_Host *shost)

if (!pool->users) {
pool->cmd_slab = kmem_cache_create(pool->cmd_name, cmd_size, 0,
pool->slab_flags, NULL);
SLAB_HWCACHE_ALIGN, NULL);
if (!pool->cmd_slab)
goto out_free_pool;
}
Expand Down

0 comments on commit eeff68c

Please sign in to comment.