Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 101539
b: refs/heads/master
c: 6362abd
h: refs/heads/master
i:
  101537: 703a263
  101535: ce83fab
v: v3
  • Loading branch information
Martin K. Petersen authored and James Bottomley committed Jul 12, 2008
1 parent e390e44 commit f946afa
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 090507157f3bc43dd925fda50f8aca7d03b616b6
refs/heads/master: 6362abd3e00d3161affad996fa53cc69a01fc6d1
26 changes: 13 additions & 13 deletions trunk/drivers/scsi/scsi_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ static struct scsi_host_sg_pool scsi_sg_pools[] = {
};
#undef SP

static struct kmem_cache *scsi_bidi_sdb_cache;
static struct kmem_cache *scsi_sdb_cache;

static void scsi_run_queue(struct request_queue *q);

Expand Down Expand Up @@ -775,7 +775,7 @@ void scsi_release_buffers(struct scsi_cmnd *cmd)
struct scsi_data_buffer *bidi_sdb =
cmd->request->next_rq->special;
scsi_free_sgtable(bidi_sdb);
kmem_cache_free(scsi_bidi_sdb_cache, bidi_sdb);
kmem_cache_free(scsi_sdb_cache, bidi_sdb);
cmd->request->next_rq->special = NULL;
}
}
Expand Down Expand Up @@ -1050,7 +1050,7 @@ int scsi_init_io(struct scsi_cmnd *cmd, gfp_t gfp_mask)

if (blk_bidi_rq(cmd->request)) {
struct scsi_data_buffer *bidi_sdb = kmem_cache_zalloc(
scsi_bidi_sdb_cache, GFP_ATOMIC);
scsi_sdb_cache, GFP_ATOMIC);
if (!bidi_sdb) {
error = BLKPREP_DEFER;
goto err_exit;
Expand Down Expand Up @@ -1692,11 +1692,11 @@ int __init scsi_init_queue(void)
return -ENOMEM;
}

scsi_bidi_sdb_cache = kmem_cache_create("scsi_bidi_sdb",
sizeof(struct scsi_data_buffer),
0, 0, NULL);
if (!scsi_bidi_sdb_cache) {
printk(KERN_ERR "SCSI: can't init scsi bidi sdb cache\n");
scsi_sdb_cache = kmem_cache_create("scsi_data_buffer",
sizeof(struct scsi_data_buffer),
0, 0, NULL);
if (!scsi_sdb_cache) {
printk(KERN_ERR "SCSI: can't init scsi sdb cache\n");
goto cleanup_io_context;
}

Expand All @@ -1709,29 +1709,29 @@ int __init scsi_init_queue(void)
if (!sgp->slab) {
printk(KERN_ERR "SCSI: can't init sg slab %s\n",
sgp->name);
goto cleanup_bidi_sdb;
goto cleanup_sdb;
}

sgp->pool = mempool_create_slab_pool(SG_MEMPOOL_SIZE,
sgp->slab);
if (!sgp->pool) {
printk(KERN_ERR "SCSI: can't init sg mempool %s\n",
sgp->name);
goto cleanup_bidi_sdb;
goto cleanup_sdb;
}
}

return 0;

cleanup_bidi_sdb:
cleanup_sdb:
for (i = 0; i < SG_MEMPOOL_NR; i++) {
struct scsi_host_sg_pool *sgp = scsi_sg_pools + i;
if (sgp->pool)
mempool_destroy(sgp->pool);
if (sgp->slab)
kmem_cache_destroy(sgp->slab);
}
kmem_cache_destroy(scsi_bidi_sdb_cache);
kmem_cache_destroy(scsi_sdb_cache);
cleanup_io_context:
kmem_cache_destroy(scsi_io_context_cache);

Expand All @@ -1743,7 +1743,7 @@ void scsi_exit_queue(void)
int i;

kmem_cache_destroy(scsi_io_context_cache);
kmem_cache_destroy(scsi_bidi_sdb_cache);
kmem_cache_destroy(scsi_sdb_cache);

for (i = 0; i < SG_MEMPOOL_NR; i++) {
struct scsi_host_sg_pool *sgp = scsi_sg_pools + i;
Expand Down

0 comments on commit f946afa

Please sign in to comment.