scsi_lib.c (b22f687dd28a7a8886b918294b4d558ef175c07d) scsi_lib.c (5972511b77809cb7c9ccdb79b825c54921c5c546)
1/*
2 * scsi_lib.c Copyright (C) 1999 Eric Youngdale
3 *
4 * SCSI queueing library.
5 * Initial versions: Eric Youngdale (eric@andante.org).
6 * Based upon conversations with large numbers
7 * of people at Linux Expo.
8 */

--- 17 unchanged lines hidden (view full) ---

26#include <scsi/scsi_eh.h>
27#include <scsi/scsi_host.h>
28
29#include "scsi_priv.h"
30#include "scsi_logging.h"
31
32
33#define SG_MEMPOOL_NR ARRAY_SIZE(scsi_sg_pools)
1/*
2 * scsi_lib.c Copyright (C) 1999 Eric Youngdale
3 *
4 * SCSI queueing library.
5 * Initial versions: Eric Youngdale (eric@andante.org).
6 * Based upon conversations with large numbers
7 * of people at Linux Expo.
8 */

--- 17 unchanged lines hidden (view full) ---

26#include <scsi/scsi_eh.h>
27#include <scsi/scsi_host.h>
28
29#include "scsi_priv.h"
30#include "scsi_logging.h"
31
32
33#define SG_MEMPOOL_NR ARRAY_SIZE(scsi_sg_pools)
34#define SG_MEMPOOL_SIZE 32
34#define SG_MEMPOOL_SIZE 2
35
36struct scsi_host_sg_pool {
37 size_t size;
38 char *name;
39 struct kmem_cache *slab;
40 mempool_t *pool;
41};
42

--- 800 unchanged lines hidden (view full) ---

843 */
844 int len = 8 + cmd->sense_buffer[7];
845
846 if (len > SCSI_SENSE_BUFFERSIZE)
847 len = SCSI_SENSE_BUFFERSIZE;
848 memcpy(req->sense, cmd->sense_buffer, len);
849 req->sense_len = len;
850 }
35
36struct scsi_host_sg_pool {
37 size_t size;
38 char *name;
39 struct kmem_cache *slab;
40 mempool_t *pool;
41};
42

--- 800 unchanged lines hidden (view full) ---

843 */
844 int len = 8 + cmd->sense_buffer[7];
845
846 if (len > SCSI_SENSE_BUFFERSIZE)
847 len = SCSI_SENSE_BUFFERSIZE;
848 memcpy(req->sense, cmd->sense_buffer, len);
849 req->sense_len = len;
850 }
851 }
852 req->data_len = cmd->resid;
851 } else
852 req->data_len = cmd->resid;
853 }
854
855 /*
856 * Next deal with any sectors which we were able to correctly
857 * handle.
858 */
859 SCSI_LOG_HLCOMPLETE(1, printk("%ld sectors total, "
860 "%d bytes done.\n",

--- 102 unchanged lines hidden (view full) ---

963 * reasons. Just retry the request and see what
964 * happens.
965 */
966 scsi_requeue_command(q, cmd);
967 return;
968 }
969 if (result) {
970 if (!(req->cmd_flags & REQ_QUIET)) {
853 }
854
855 /*
856 * Next deal with any sectors which we were able to correctly
857 * handle.
858 */
859 SCSI_LOG_HLCOMPLETE(1, printk("%ld sectors total, "
860 "%d bytes done.\n",

--- 102 unchanged lines hidden (view full) ---

963 * reasons. Just retry the request and see what
964 * happens.
965 */
966 scsi_requeue_command(q, cmd);
967 return;
968 }
969 if (result) {
970 if (!(req->cmd_flags & REQ_QUIET)) {
971 scsi_print_result(cmd);
971 scmd_printk(KERN_INFO, cmd,
972 "SCSI error: return code = 0x%08x\n",
973 result);
972 if (driver_byte(result) & DRIVER_SENSE)
973 scsi_print_sense("", cmd);
974 }
975 }
976 scsi_end_request(cmd, 0, this_count, !result);
977}
978EXPORT_SYMBOL(scsi_io_completion);
979

--- 1313 unchanged lines hidden ---
974 if (driver_byte(result) & DRIVER_SENSE)
975 scsi_print_sense("", cmd);
976 }
977 }
978 scsi_end_request(cmd, 0, this_count, !result);
979}
980EXPORT_SYMBOL(scsi_io_completion);
981

--- 1313 unchanged lines hidden ---