Merge git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[sfrench/cifs-2.6.git] / drivers / scsi / scsi_lib.c
index 0f9b6c2754177e44026b925440f52cfd85de73ac..61fbcdcbb009e93ae5d59ef11fb95d6a416cf82c 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;
@@ -388,10 +388,9 @@ int scsi_execute_async(struct scsi_device *sdev, const unsigned char *cmd,
        int err = 0;
        int write = (data_direction == DMA_TO_DEVICE);
 
-       sioc = kmem_cache_alloc(scsi_io_context_cache, gfp);
+       sioc = kmem_cache_zalloc(scsi_io_context_cache, gfp);
        if (!sioc)
                return DRIVER_ERROR << 24;
-       memset(sioc, 0, sizeof(*sioc));
 
        req = blk_get_request(sdev->request_queue, write, gfp);
        if (!req)
@@ -849,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;
        }
 
        /*
@@ -969,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);
                }