mm: Remove slab destructors from kmem_cache_create().
[sfrench/cifs-2.6.git] / drivers / scsi / scsi_lib.c
index a1cd6e6a292aa887216837b77b6f2dc744b1a12f..da63c544919bd9f306df81dae5d8c7a7951fcb5b 100644 (file)
@@ -31,7 +31,7 @@
 
 
 #define SG_MEMPOOL_NR          ARRAY_SIZE(scsi_sg_pools)
-#define SG_MEMPOOL_SIZE                32
+#define SG_MEMPOOL_SIZE                2
 
 struct scsi_host_sg_pool {
        size_t          size;
@@ -173,7 +173,7 @@ int scsi_queue_insert(struct scsi_cmnd *cmd, int reason)
  * @retries:   number of times to retry request
  * @flags:     or into request flags;
  *
- * returns the req->errors value which is the the scsi_cmnd result
+ * returns the req->errors value which is the scsi_cmnd result
  * field.
  **/
 int scsi_execute(struct scsi_device *sdev, const unsigned char *cmd,
@@ -848,8 +848,8 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes)
                                memcpy(req->sense, cmd->sense_buffer,  len);
                                req->sense_len = len;
                        }
-               } else
-                       req->data_len = cmd->resid;
+               }
+               req->data_len = cmd->resid;
        }
 
        /*
@@ -968,9 +968,7 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes)
        }
        if (result) {
                if (!(req->cmd_flags & REQ_QUIET)) {
-                       scmd_printk(KERN_INFO, cmd,
-                                   "SCSI error: return code = 0x%08x\n",
-                                   result);
+                       scsi_print_result(cmd);
                        if (driver_byte(result) & DRIVER_SENSE)
                                scsi_print_sense("", cmd);
                }
@@ -1399,7 +1397,7 @@ static void scsi_softirq_done(struct request *rq)
                        scsi_finish_command(cmd);
                        break;
                case NEEDS_RETRY:
-                       scsi_retry_command(cmd);
+                       scsi_queue_insert(cmd, SCSI_MLQUEUE_EH_RETRY);
                        break;
                case ADD_TO_MLQUEUE:
                        scsi_queue_insert(cmd, SCSI_MLQUEUE_DEVICE_BUSY);
@@ -1663,7 +1661,7 @@ int __init scsi_init_queue(void)
 
        scsi_io_context_cache = kmem_cache_create("scsi_io_context",
                                        sizeof(struct scsi_io_context),
-                                       0, 0, NULL, NULL);
+                                       0, 0, NULL);
        if (!scsi_io_context_cache) {
                printk(KERN_ERR "SCSI: can't init scsi io context cache\n");
                return -ENOMEM;
@@ -1674,7 +1672,7 @@ int __init scsi_init_queue(void)
                int size = sgp->size * sizeof(struct scatterlist);
 
                sgp->slab = kmem_cache_create(sgp->name, size, 0,
-                               SLAB_HWCACHE_ALIGN, NULL, NULL);
+                               SLAB_HWCACHE_ALIGN, NULL);
                if (!sgp->slab) {
                        printk(KERN_ERR "SCSI: can't init sg slab %s\n",
                                        sgp->name);
@@ -2249,6 +2247,8 @@ void *scsi_kmap_atomic_sg(struct scatterlist *sg, int sg_count,
        size_t sg_len = 0, len_complete = 0;
        struct page *page;
 
+       WARN_ON(!irqs_disabled());
+
        for (i = 0; i < sg_count; i++) {
                len_complete = sg_len; /* Complete sg-entries */
                sg_len += sg[i].length;