remove scsi_request infrastructure
Subsystems (2)
PATCH 1/1 remove scsi_request infrastructure
With Achim patch the last user (gdth) is switched away from scsi_request so we an kill it now. Also disables some code in i2o_scsi that was broken since the sg driver stopped using scsi_requests.
Signed-off-by Christoph Hellwig <[email protected]>
drivers/message/i2o/i2o_scsi.c +2 -2
@@ -65,9 +65,7 @@#include <scsi/scsi_host.h> #include <scsi/scsi_device.h> #include <scsi/scsi_cmnd.h> -#include <scsi/scsi_request.h> #include <scsi/sg.h> -#include <scsi/sg_request.h> #define OSM_NAME "scsi-osm"#define OSM_VERSION "1.316"
@@ -588,6 +586,7 @@ mptr = &msg->body[0 ]; +#if 0 /* this code can't work */ #ifdef CONFIG_I2O_EXT_ADAPTEC if (c->adaptec) { u32 adpt_flags = 0;
@@ -625,6 +624,7 @@ *mptr++ =cpu_to_le32 (adpt_flags | tid); }#endif +#endif msg->u.head[1 ] =cpu_to_le32 (cmd |HOST_TID <<12 | tid); msg->u.s.icntxt =cpu_to_le32 (i2o_scsi_driver.context);
drivers/scsi/constants.c +1 -11
@@ -13,9 +13,9 @@#include <linux/kernel.h> #include <scsi/scsi.h> +#include <scsi/scsi_cmnd.h> #include <scsi/scsi_device.h> #include <scsi/scsi_host.h> -#include <scsi/scsi_request.h> #include <scsi/scsi_eh.h> #include <scsi/scsi_dbg.h>
@@ -1268,16 +1268,6 @@ }EXPORT_SYMBOL (scsi_print_sense); -void scsi_print_req_sense (const char *devclass,struct scsi_request *sreq) -{ -const char *name = devclass; - -if (sreq->sr_request->rq_disk) - name = sreq->sr_request->rq_disk->disk_name; -__scsi_print_sense (name, sreq->sr_sense_buffer,SCSI_SENSE_BUFFERSIZE ); -} -EXPORT_SYMBOL (scsi_print_req_sense); -void scsi_print_command (struct scsi_cmnd *cmd) {/* Assume appended output (i.e. not at start of line) */
drivers/scsi/gdth.c +4 -4
@@ -716,8 +716,8 @@ {TRACE2 (("gdth_scsi_done()\n" )); -if (scp->sc_request) -complete ((struct completion *)scp->sc_request); +if (scp->request) +complete ((struct completion *)scp->request); } int __gdth_execute(struct scsi_device *sdev, gdth_cmd_str *gdtcmd, char *cmnd,
@@ -732,8 +732,8 @@return -ENOMEM ;memset (scp,0 ,sizeof (*scp)); scp->device = sdev; -/* use sc_request field to save the ptr. to completion struct. */ - scp->sc_request = (struct scsi_request *)&wait; +/* use request field to save the ptr. to completion struct. */ + scp->request = (struct request *)&wait; scp->timeout_per_command = timeout*HZ ; scp->request_buffer = gdtcmd; scp->cmd_len =12 ;
drivers/scsi/ipr.c +0 -1
@@ -79,7 +79,6 @@#include <scsi/scsi_tcq.h> #include <scsi/scsi_eh.h> #include <scsi/scsi_cmnd.h> -#include <scsi/scsi_request.h> #include "ipr.h" /*
drivers/scsi/libata-scsi.c +1 -1
@@ -38,9 +38,9 @@#include <linux/spinlock.h> #include <scsi/scsi.h> #include <scsi/scsi_host.h> +#include <scsi/scsi_cmnd.h> #include <scsi/scsi_eh.h> #include <scsi/scsi_device.h> -#include <scsi/scsi_request.h> #include <scsi/scsi_transport.h> #include <linux/libata.h> #include <linux/hdreg.h>
drivers/scsi/qlogicpti.c +0 -1
@@ -43,7 +43,6 @@#include <scsi/scsi_cmnd.h> #include <scsi/scsi_device.h> #include <scsi/scsi_eh.h> -#include <scsi/scsi_request.h> #include <scsi/scsi_tcq.h> #include <scsi/scsi_host.h>
drivers/scsi/scsi.c +0 -157
187 lines not on this page · raw message
drivers/scsi/scsi.h +0 -1
@@ -25,7 +25,6 @@#include <scsi/scsi_cmnd.h> #include <scsi/scsi_device.h> #include <scsi/scsi_eh.h> -#include <scsi/scsi_request.h> #include <scsi/scsi_tcq.h> #include <scsi/scsi.h>
drivers/scsi/scsi_error.c +1 -11
@@ -26,13 +26,13 @@#include <linux/delay.h> #include <scsi/scsi.h> +#include <scsi/scsi_cmnd.h> #include <scsi/scsi_dbg.h> #include <scsi/scsi_device.h> #include <scsi/scsi_eh.h> #include <scsi/scsi_transport.h> #include <scsi/scsi_host.h> #include <scsi/scsi_ioctl.h> -#include <scsi/scsi_request.h> #include "scsi_priv.h" #include "scsi_logging.h"
@@ -1671,8 +1671,6 @@ scmd->cmd_len =0 ; scmd->sc_data_direction =DMA_BIDIRECTIONAL ; - scmd->sc_request =NULL ; - scmd->sc_magic =SCSI_CMND_MAGIC ;init_timer (&scmd->eh_timeout);
@@ -1769,14 +1767,6 @@ }EXPORT_SYMBOL (scsi_normalize_sense); -int scsi_request_normalize_sense (struct scsi_request *sreq, -struct scsi_sense_hdr *sshdr) -{ -return scsi_normalize_sense (sreq->sr_sense_buffer, -sizeof (sreq->sr_sense_buffer), sshdr); -} -EXPORT_SYMBOL (scsi_request_normalize_sense); -int scsi_command_normalize_sense (struct scsi_cmnd *cmd,struct scsi_sense_hdr *sshdr) {
drivers/scsi/scsi_ioctl.c +1 -1
@@ -15,11 +15,11 @@#include <asm/uaccess.h> #include <scsi/scsi.h> +#include <scsi/scsi_cmnd.h> #include <scsi/scsi_device.h> #include <scsi/scsi_eh.h> #include <scsi/scsi_host.h> #include <scsi/scsi_ioctl.h> -#include <scsi/scsi_request.h> #include <scsi/sg.h> #include <scsi/scsi_dbg.h>
drivers/scsi/scsi_lib.c +3 -77
109 lines not on this page · raw message
drivers/scsi/scsi_priv.h +0 -10
@@ -8,17 +8,10 @@struct scsi_cmnd ;struct scsi_device ;struct scsi_host_template ; -struct scsi_request ;struct Scsi_Host ;/* -* Magic values for certain scsi structs. Shouldn't ever be used. -*/ -#define SCSI_CMND_MAGIC 0xE25C23A5 -#define SCSI_REQ_MAGIC 0x75F6D354 - -/* * Scsi Error Handler Flags */ #define SCSI_EH_CANCEL_CMD 0x0001/* Cancel this cmd */
@@ -34,9 +27,6 @@extern int scsi_dispatch_cmd (struct scsi_cmnd *cmd);extern int scsi_setup_command_freelist (struct Scsi_Host *shost);extern void scsi_destroy_command_freelist (struct Scsi_Host *shost); -extern void scsi_init_cmd_from_req (struct scsi_cmnd *cmd, -struct scsi_request *sreq); -extern void __scsi_release_request (struct scsi_request *sreq);extern void __scsi_done (struct scsi_cmnd *cmd);extern int scsi_retry_command (struct scsi_cmnd *cmd);#ifdef CONFIG_SCSI_LOGGING
drivers/scsi/scsi_scan.c +1 -1
@@ -33,11 +33,11 @@#include <asm/semaphore.h> #include <scsi/scsi.h> +#include <scsi/scsi_cmnd.h> #include <scsi/scsi_device.h> #include <scsi/scsi_driver.h> #include <scsi/scsi_devinfo.h> #include <scsi/scsi_host.h> -#include <scsi/scsi_request.h> #include <scsi/scsi_transport.h> #include <scsi/scsi_eh.h>
drivers/scsi/scsi_typedefs.h +0 -1
@@ -1,3 +1,2 @@typedef struct scsi_cmnd Scsi_Cmnd ; -typedef struct scsi_request Scsi_Request ;
include/scsi/scsi_cmnd.h +0 -6
@@ -9,7 +9,6 @@struct request ;struct scatterlist ;struct scsi_device ; -struct scsi_request ;/* embedded in scsi_cmnd */
@@ -29,13 +28,8 @@ };struct scsi_cmnd { -int sc_magic; -struct scsi_device *device; -struct scsi_request *sc_request; -struct list_head list;/* scsi_cmnd participates in queue lists */ -struct list_head eh_entry;/* entry for the host eh_cmd_q */ int eh_eflags;/* Used by error handlr */ void (*done) (struct scsi_cmnd *);/* Mid-level done function */
include/scsi/scsi_dbg.h +0 -2
@@ -2,14 +2,12 @@#define _SCSI_SCSI_DBG_Hstruct scsi_cmnd ; -struct scsi_request ;struct scsi_sense_hdr ;extern void scsi_print_command (struct scsi_cmnd *);extern void scsi_print_sense_hdr (const char *,struct scsi_sense_hdr *);extern void __scsi_print_command (unsigned char *);extern void scsi_print_sense (const char *,struct scsi_cmnd *); -extern void scsi_print_req_sense (const char *,struct scsi_request *);extern void __scsi_print_sense (const char *name,const unsigned char *sense_buffer,int sense_len);
include/scsi/scsi_eh.h +0 -3
@@ -3,7 +3,6 @@struct scsi_cmnd ;struct scsi_device ; -struct scsi_request ;struct Scsi_Host ;/*
@@ -43,8 +42,6 @@extern int scsi_block_when_processing_errors (struct scsi_device *);extern int scsi_normalize_sense (const u8 *sense_buffer,int sb_len,struct scsi_sense_hdr *sshdr); -extern int scsi_request_normalize_sense (struct scsi_request *sreq, -struct scsi_sense_hdr *sshdr);extern int scsi_command_normalize_sense (struct scsi_cmnd *cmd,struct scsi_sense_hdr *sshdr);
include/scsi/scsi_request.h deleted +0 -54
54 lines not on this page · raw message
include/scsi/sg_request.h deleted +0 -26
@@ -1,26 +0,0 @@ -typedef struct scsi_request Scsi_Request ; - -static Scsi_Request *dummy_cmdp;/* only used for sizeof */ - -typedef struct sg_scatter_hold {/* holding area for scsi scatter gather info */ -unsigned short k_use_sg;/* Count of kernel scatter-gather pieces */ -unsigned short sglist_len;/* size of malloc'd scatter-gather list ++ */ -unsigned bufflen;/* Size of (aggregate) data buffer */ -unsigned b_malloc_len;/* actual len malloc'ed in buffer */ -void *buffer;/* Data buffer or scatter list (k_use_sg>0) */ -char dio_in_use;/* 0->indirect IO (or mmap), 1->dio */ -unsigned char cmd_opcode;/* first byte of command */ -}Sg_scatter_hold ; - -typedef struct sg_request {/* SG_MAX_QUEUE requests outstanding per file */ -Scsi_Request *my_cmdp;/* != 0 when request with lower levels */ -struct sg_request *nextrp;/* NULL -> tail request (slist) */ -struct sg_fd *parentfp;/* NULL -> not in use */ -Sg_scatter_hold data;/* hold buffer, perhaps scatter list */ -sg_io_hdr_t header;/* scsi command+info, see <scsi/sg.h> */ -unsigned char sense_b[sizeof (dummy_cmdp->sr_sense_buffer)]; -char res_used;/* 1 -> using reserve buffer, 0 -> not ... */ -char orphan;/* 1 -> drop on sight, 0 -> normal */ -char sg_io_owned;/* 1 -> packet belongs to SG_IO */ -volatile char done;/* 0->before bh, 1->before read, 2->read */ -}Sg_request ;