aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_lib.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-07-15 21:58:04 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-15 21:58:04 -0400
commit89a93f2f4834f8c126e8d9dd6b368d0b9e21ec3d (patch)
treee731456fec0cab1225ad3e806dc8d3efefa0a78b /drivers/scsi/scsi_lib.c
parent260eddf4391f162a69d1d163729249635fa7a78f (diff)
parentfe9233fb6914a0eb20166c967e3020f7f0fba2c9 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (102 commits) [SCSI] scsi_dh: fix kconfig related build errors [SCSI] sym53c8xx: Fix bogus sym_que_entry re-implementation of container_of [SCSI] scsi_cmnd.h: remove double inclusion of linux/blkdev.h [SCSI] make struct scsi_{host,target}_type static [SCSI] fix locking in host use of blk_plug_device() [SCSI] zfcp: Cleanup external header file [SCSI] zfcp: Cleanup code in zfcp_erp.c [SCSI] zfcp: zfcp_fsf cleanup. [SCSI] zfcp: consolidate sysfs things into one file. [SCSI] zfcp: Cleanup of code in zfcp_aux.c [SCSI] zfcp: Cleanup of code in zfcp_scsi.c [SCSI] zfcp: Move status accessors from zfcp to SCSI include file. [SCSI] zfcp: Small QDIO cleanups [SCSI] zfcp: Adapter reopen for large number of unsolicited status [SCSI] zfcp: Fix error checking for ELS ADISC requests [SCSI] zfcp: wait until adapter is finished with ERP during auto-port [SCSI] ibmvfc: IBM Power Virtual Fibre Channel Adapter Client Driver [SCSI] sg: Add target reset support [SCSI] lib: Add support for the T10 (SCSI) Data Integrity Field CRC [SCSI] sd: Move scsi_disk() accessor function to sd.h ...
Diffstat (limited to 'drivers/scsi/scsi_lib.c')
-rw-r--r--drivers/scsi/scsi_lib.c35
1 files changed, 21 insertions, 14 deletions
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index cbf55d59a54c..88d1b5f44e59 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -65,7 +65,7 @@ static struct scsi_host_sg_pool scsi_sg_pools[] = {
65}; 65};
66#undef SP 66#undef SP
67 67
68static struct kmem_cache *scsi_bidi_sdb_cache; 68static struct kmem_cache *scsi_sdb_cache;
69 69
70static void scsi_run_queue(struct request_queue *q); 70static void scsi_run_queue(struct request_queue *q);
71 71
@@ -784,7 +784,7 @@ void scsi_release_buffers(struct scsi_cmnd *cmd)
784 struct scsi_data_buffer *bidi_sdb = 784 struct scsi_data_buffer *bidi_sdb =
785 cmd->request->next_rq->special; 785 cmd->request->next_rq->special;
786 scsi_free_sgtable(bidi_sdb); 786 scsi_free_sgtable(bidi_sdb);
787 kmem_cache_free(scsi_bidi_sdb_cache, bidi_sdb); 787 kmem_cache_free(scsi_sdb_cache, bidi_sdb);
788 cmd->request->next_rq->special = NULL; 788 cmd->request->next_rq->special = NULL;
789 } 789 }
790} 790}
@@ -1059,7 +1059,7 @@ int scsi_init_io(struct scsi_cmnd *cmd, gfp_t gfp_mask)
1059 1059
1060 if (blk_bidi_rq(cmd->request)) { 1060 if (blk_bidi_rq(cmd->request)) {
1061 struct scsi_data_buffer *bidi_sdb = kmem_cache_zalloc( 1061 struct scsi_data_buffer *bidi_sdb = kmem_cache_zalloc(
1062 scsi_bidi_sdb_cache, GFP_ATOMIC); 1062 scsi_sdb_cache, GFP_ATOMIC);
1063 if (!bidi_sdb) { 1063 if (!bidi_sdb) {
1064 error = BLKPREP_DEFER; 1064 error = BLKPREP_DEFER;
1065 goto err_exit; 1065 goto err_exit;
@@ -1169,6 +1169,14 @@ int scsi_setup_fs_cmnd(struct scsi_device *sdev, struct request *req)
1169 1169
1170 if (ret != BLKPREP_OK) 1170 if (ret != BLKPREP_OK)
1171 return ret; 1171 return ret;
1172
1173 if (unlikely(sdev->scsi_dh_data && sdev->scsi_dh_data->scsi_dh
1174 && sdev->scsi_dh_data->scsi_dh->prep_fn)) {
1175 ret = sdev->scsi_dh_data->scsi_dh->prep_fn(sdev, req);
1176 if (ret != BLKPREP_OK)
1177 return ret;
1178 }
1179
1172 /* 1180 /*
1173 * Filesystem requests must transfer data. 1181 * Filesystem requests must transfer data.
1174 */ 1182 */
@@ -1329,7 +1337,6 @@ static inline int scsi_host_queue_ready(struct request_queue *q,
1329 printk("scsi%d unblocking host at zero depth\n", 1337 printk("scsi%d unblocking host at zero depth\n",
1330 shost->host_no)); 1338 shost->host_no));
1331 } else { 1339 } else {
1332 blk_plug_device(q);
1333 return 0; 1340 return 0;
1334 } 1341 }
1335 } 1342 }
@@ -1693,11 +1700,11 @@ int __init scsi_init_queue(void)
1693 return -ENOMEM; 1700 return -ENOMEM;
1694 } 1701 }
1695 1702
1696 scsi_bidi_sdb_cache = kmem_cache_create("scsi_bidi_sdb", 1703 scsi_sdb_cache = kmem_cache_create("scsi_data_buffer",
1697 sizeof(struct scsi_data_buffer), 1704 sizeof(struct scsi_data_buffer),
1698 0, 0, NULL); 1705 0, 0, NULL);
1699 if (!scsi_bidi_sdb_cache) { 1706 if (!scsi_sdb_cache) {
1700 printk(KERN_ERR "SCSI: can't init scsi bidi sdb cache\n"); 1707 printk(KERN_ERR "SCSI: can't init scsi sdb cache\n");
1701 goto cleanup_io_context; 1708 goto cleanup_io_context;
1702 } 1709 }
1703 1710
@@ -1710,7 +1717,7 @@ int __init scsi_init_queue(void)
1710 if (!sgp->slab) { 1717 if (!sgp->slab) {
1711 printk(KERN_ERR "SCSI: can't init sg slab %s\n", 1718 printk(KERN_ERR "SCSI: can't init sg slab %s\n",
1712 sgp->name); 1719 sgp->name);
1713 goto cleanup_bidi_sdb; 1720 goto cleanup_sdb;
1714 } 1721 }
1715 1722
1716 sgp->pool = mempool_create_slab_pool(SG_MEMPOOL_SIZE, 1723 sgp->pool = mempool_create_slab_pool(SG_MEMPOOL_SIZE,
@@ -1718,13 +1725,13 @@ int __init scsi_init_queue(void)
1718 if (!sgp->pool) { 1725 if (!sgp->pool) {
1719 printk(KERN_ERR "SCSI: can't init sg mempool %s\n", 1726 printk(KERN_ERR "SCSI: can't init sg mempool %s\n",
1720 sgp->name); 1727 sgp->name);
1721 goto cleanup_bidi_sdb; 1728 goto cleanup_sdb;
1722 } 1729 }
1723 } 1730 }
1724 1731
1725 return 0; 1732 return 0;
1726 1733
1727cleanup_bidi_sdb: 1734cleanup_sdb:
1728 for (i = 0; i < SG_MEMPOOL_NR; i++) { 1735 for (i = 0; i < SG_MEMPOOL_NR; i++) {
1729 struct scsi_host_sg_pool *sgp = scsi_sg_pools + i; 1736 struct scsi_host_sg_pool *sgp = scsi_sg_pools + i;
1730 if (sgp->pool) 1737 if (sgp->pool)
@@ -1732,7 +1739,7 @@ cleanup_bidi_sdb:
1732 if (sgp->slab) 1739 if (sgp->slab)
1733 kmem_cache_destroy(sgp->slab); 1740 kmem_cache_destroy(sgp->slab);
1734 } 1741 }
1735 kmem_cache_destroy(scsi_bidi_sdb_cache); 1742 kmem_cache_destroy(scsi_sdb_cache);
1736cleanup_io_context: 1743cleanup_io_context:
1737 kmem_cache_destroy(scsi_io_context_cache); 1744 kmem_cache_destroy(scsi_io_context_cache);
1738 1745
@@ -1744,7 +1751,7 @@ void scsi_exit_queue(void)
1744 int i; 1751 int i;
1745 1752
1746 kmem_cache_destroy(scsi_io_context_cache); 1753 kmem_cache_destroy(scsi_io_context_cache);
1747 kmem_cache_destroy(scsi_bidi_sdb_cache); 1754 kmem_cache_destroy(scsi_sdb_cache);
1748 1755
1749 for (i = 0; i < SG_MEMPOOL_NR; i++) { 1756 for (i = 0; i < SG_MEMPOOL_NR; i++) {
1750 struct scsi_host_sg_pool *sgp = scsi_sg_pools + i; 1757 struct scsi_host_sg_pool *sgp = scsi_sg_pools + i;