tgt: Removal
PATCH 6/7 tgt: Removal
Because of the conversion of the ibmvstgt driver from tgt to SCST, and because the ibmvstgt driver was the only user of scsi_tgt, the scsi_tgt kernel module, the CONFIG_SCSI_TGT, CONFIG_SCSI_SRP_TGT_ATTRS and CONFIG_SCSI_FC_TGT_ATTRS kbuild variable, the scsi_host_template member variables transfer_response, supported_mode and active_mode and the constants MODE_UNKNOWN, MODE_INITIATOR and MODE_TARGET are no longer needed.
Signed-off-by Bart Van Assche <[email protected]>
Cc Fujita Tomonori <[email protected]>
Cc Brian King <[email protected]>
Cc Robert Jennings <[email protected]>
--- drivers/scsi/Makefile | 3 - drivers/scsi/hosts.c | 6 - drivers/scsi/scsi_sysfs.c | 32 +-- drivers/scsi/scsi_tgt_if.c | 398 ----------------- drivers/scsi/scsi_tgt_lib.c | 662 ---------------------------- drivers/scsi/scsi_tgt_priv.h | 32 -- drivers/scsi/scsi_transport_fc.c | 12 - drivers/scsi/scsi_transport_fc_internal.h | 26 -- drivers/scsi/scsi_transport_srp.c | 18 - drivers/scsi/scsi_transport_srp_internal.h | 25 - include/scsi/scsi_host.h | 33 -- include/scsi/scsi_tgt.h | 21 - include/scsi/scsi_tgt_if.h | 108 ----- 13 files changed, 2 insertions(+), 1374 deletions(-) delete mode 100644 drivers/scsi/scsi_tgt_if.c delete mode 100644 drivers/scsi/scsi_tgt_lib.c delete mode 100644 drivers/scsi/scsi_tgt_priv.h delete mode 100644 drivers/scsi/scsi_transport_fc_internal.h delete mode 100644 include/scsi/scsi_tgt.h delete mode 100644 include/scsi/scsi_tgt_if.h
drivers/scsi/Makefile +0 -3
@@ -20,7 +20,6 @@ CFLAGS_gdth.o = # -DDEBUG_GDTH=2 -D__SERIAL__ -D__COM2__ -DGDTH_STATISTICS obj-$(CONFIG_PCMCIA) += pcmcia/ obj-$(CONFIG_SCSI) += scsi_mod.o -obj-$(CONFIG_SCSI_TGT) += scsi_tgt.o obj-$(CONFIG_RAID_ATTRS) += raid_class.o
@@ -167,8 +166,6 @@ scsi_mod-$(CONFIG_SCSI_PROC_FS) += scsi_proc.o scsi_mod-y += scsi_trace.o scsi_mod-$(CONFIG_PM_OPS) += scsi_pm.o -scsi_tgt-y += scsi_tgt_lib.o scsi_tgt_if.o - sd_mod-objs := sd.o sd_mod-$(CONFIG_BLK_DEV_INTEGRITY) += sd_dif.o
drivers/scsi/hosts.c +0 -6
@@ -382,12 +382,6 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize) shost->use_clustering = sht->use_clustering; shost->ordered_tag = sht->ordered_tag; -if (sht->supported_mode ==MODE_UNKNOWN ) -/* means we didn't set it ... default to INITIATOR */ - shost->active_mode =MODE_INITIATOR ; -else - shost->active_mode = sht->supported_mode; -if (sht->max_host_blocked) shost->max_host_blocked = sht->max_host_blocked;else
drivers/scsi/scsi_sysfs.c +2 -30
@@ -201,33 +201,10 @@ struct device_attribute dev_attr_hstate =__ATTR (state,S_IRUGO |S_IWUSR , show_shost_state, store_shost_state);static ssize_t -show_shost_mode (unsigned int mode,char *buf) -{ -ssize_t len =0 ; - -if (mode &MODE_INITIATOR ) - len =sprintf (buf,"%s" ,"Initiator" ); - -if (mode &MODE_TARGET ) - len +=sprintf (buf + len,"%s%s" , len ?", " :"" ,"Target" ); - - len +=sprintf (buf + len,"\n" ); - -return len; -} - -static ssize_t show_shost_supported_mode (struct device *dev,struct device_attribute *attr,char *buf) { -struct Scsi_Host *shost =class_to_shost (dev); -unsigned int supported_mode = shost->hostt->supported_mode; - -if (supported_mode ==MODE_UNKNOWN ) -/* by default this should be initiator */ - supported_mode =MODE_INITIATOR ; - -return show_shost_mode (supported_mode, buf); +return sprintf (buf,"Initiator\n" ); } static DEVICE_ATTR(supported_mode, S_IRUGO | S_IWUSR, show_shost_supported_mode, NULL);
@@ -236,12 +213,7 @@ static ssize_t show_shost_active_mode(struct device *dev, struct device_attribute *attr, char *buf) { - struct Scsi_Host *shost = class_to_shost(dev); - -if (shost->active_mode ==MODE_UNKNOWN ) -return snprintf (buf,20 ,"unknown\n" ); -else -return show_shost_mode (shost->active_mode, buf); + return sprintf(buf, "Initiator\n"); } static DEVICE_ATTR(active_mode, S_IRUGO | S_IWUSR, show_shost_active_mode, NULL);
drivers/scsi/scsi_tgt_if.c deleted +0 -398
398 lines not on this page · raw message
drivers/scsi/scsi_tgt_lib.c deleted +0 -662
662 lines not on this page · raw message
drivers/scsi/scsi_tgt_priv.h deleted +0 -32
@@ -1,32 +0,0 @@ -struct scsi_cmnd ; -struct scsi_lun ; -struct Scsi_Host ; -struct task_struct ; - -/* tmp - will replace with SCSI logging stuff */ -#define eprintk(fmt, args...) \ -do { \ - printk("%s(%d) " fmt, __func__, __LINE__, ##args); \ -} while (0) - -#define dprintk(fmt, args...) -/* #define dprintk eprintk */ - -extern void scsi_tgt_if_exit (void ); -extern int scsi_tgt_if_init (void ); - -extern int scsi_tgt_uspace_send_cmd (struct scsi_cmnd *cmd,u64 it_nexus_id, -struct scsi_lun *lun,u64 tag); -extern int scsi_tgt_uspace_send_status (struct scsi_cmnd *cmd,u64 it_nexus_id, -u64 tag); -extern int scsi_tgt_kspace_exec (int host_no,u64 it_nexus_id,int result,u64 tag, -unsigned long uaddr,u32 len, -unsigned long sense_uaddr,u32 sense_len,u8 rw); -extern int scsi_tgt_uspace_send_tsk_mgmt (int host_no,u64 it_nexus_id, -int function,u64 tag, -struct scsi_lun *scsilun,void *data); -extern int scsi_tgt_kspace_tsk_mgmt (int host_no,u64 it_nexus_id, -u64 mid,int result); -extern int scsi_tgt_uspace_send_it_nexus_request (int host_no,u64 it_nexus_id, -int function,char *initiator); -extern int scsi_tgt_kspace_it_nexus_rsp (int host_no,u64 it_nexus_id,int result);
drivers/scsi/scsi_transport_fc.c +0 -12
@@ -40,7 +40,6 @@#include <scsi/scsi_netlink_fc.h> #include <scsi/scsi_bsg_fc.h> #include "scsi_priv.h" -#include "scsi_transport_fc_internal.h" static int fc_queue_work (struct Scsi_Host *,struct work_struct *);static void fc_vport_sched_delete (struct work_struct *work);
@@ -2964,10 +2963,6 @@ fc_remote_port_delete(struct fc_rport *rport)spin_unlock_irqrestore (shost->host_lock, flags); -if (rport->roles &FC_PORT_ROLE_FCP_INITIATOR && - shost->active_mode &MODE_TARGET ) -fc_tgt_it_nexus_destroy (shost, (unsigned long )rport); -scsi_target_block (&rport->dev);/* see if we need to kill io faster than waiting for device loss */
@@ -3008,7 +3003,6 @@ fc_remote_port_rolechg(struct fc_rport *rport, u32 roles)struct fc_host_attrs *fc_host =shost_to_fc_host (shost);unsigned long flags;int create =0 ; -int ret;spin_lock_irqsave (shost->host_lock, flags);if (roles &FC_PORT_ROLE_FCP_TARGET ) {
@@ -3017,12 +3011,6 @@ fc_remote_port_rolechg(struct fc_rport *rport, u32 roles) create =1 ; }else if (!(rport->roles &FC_PORT_ROLE_FCP_TARGET )) create =1 ; - }else if (shost->active_mode &MODE_TARGET ) { - ret =fc_tgt_it_nexus_create (shost, (unsigned long )rport, - (char *)&rport->node_name); -if (ret) -printk (KERN_ERR "FC Remore Port tgt nexus failed %d\n" , - ret); } rport->roles = roles;
drivers/scsi/scsi_transport_fc_internal.h deleted +0 -26
@@ -1,26 +0,0 @@ -#include <scsi/scsi_tgt.h> - -#ifdef CONFIG_SCSI_FC_TGT_ATTRS -static inline int fc_tgt_it_nexus_create (struct Scsi_Host *shost,u64 itn_id, -char *initiator) -{ -return scsi_tgt_it_nexus_create (shost, itn_id, initiator); -} - -static inline int fc_tgt_it_nexus_destroy (struct Scsi_Host *shost,u64 itn_id) -{ -return scsi_tgt_it_nexus_destroy (shost, itn_id); -} -#else -static inline int fc_tgt_it_nexus_create (struct Scsi_Host *shost,u64 itn_id, -char *initiator) -{ -return 0 ; -} - -static inline int fc_tgt_it_nexus_destroy (struct Scsi_Host *shost,u64 itn_id) -{ -return 0 ; -} - -#endif
drivers/scsi/scsi_transport_srp.c +0 -18
@@ -30,7 +30,6 @@#include <scsi/scsi_host.h> #include <scsi/scsi_transport.h> #include <scsi/scsi_transport_srp.h> -#include "scsi_transport_srp_internal.h" struct srp_host_attrs {atomic_t next_port_id;
@@ -223,18 +222,6 @@ struct srp_rport *srp_rport_add(struct Scsi_Host *shost,return ERR_PTR (ret); } -if (shost->active_mode &MODE_TARGET && - ids->roles ==SRP_RPORT_ROLE_INITIATOR ) { - ret =srp_tgt_it_nexus_create (shost, (unsigned long )rport, - rport->port_id); -if (ret) { -device_del (&rport->dev); -transport_destroy_device (&rport->dev); -put_device (&rport->dev); -return ERR_PTR (ret); - } - } -transport_add_device (&rport->dev);transport_configure_device (&rport->dev);
@@ -251,11 +238,6 @@ EXPORT_SYMBOL_GPL(srp_rport_add);void srp_rport_del (struct srp_rport *rport) {struct device *dev = &rport->dev; -struct Scsi_Host *shost =dev_to_shost (dev->parent); - -if (shost->active_mode &MODE_TARGET && - rport->roles ==SRP_RPORT_ROLE_INITIATOR ) -srp_tgt_it_nexus_destroy (shost, (unsigned long )rport);transport_remove_device (dev);device_del (dev);
drivers/scsi/scsi_transport_srp_internal.h +0 -25
@@ -1,25 +0,0 @@ -#include <scsi/scsi_tgt.h> - -#ifdef CONFIG_SCSI_SRP_TGT_ATTRS -static inline int srp_tgt_it_nexus_create (struct Scsi_Host *shost,u64 itn_id, -char *initiator) -{ -return scsi_tgt_it_nexus_create (shost, itn_id, initiator); -} - -static inline int srp_tgt_it_nexus_destroy (struct Scsi_Host *shost,u64 itn_id) -{ -return scsi_tgt_it_nexus_destroy (shost, itn_id); -} - -#else -static inline int srp_tgt_it_nexus_create (struct Scsi_Host *shost,u64 itn_id, -char *initiator) -{ -return 0 ; -} -static inline int srp_tgt_it_nexus_destroy (struct Scsi_Host *shost,u64 itn_id) -{ -return 0 ; -} -#endif
include/scsi/scsi_host.h +0 -33
@@ -20,7 +20,6 @@ struct scsi_host_cmd_pool;struct scsi_transport_template ;struct blk_queue_tags ; -/* * The various choices mean: * NONE: Self evident. Host adapter is not capable of scatter-gather.
@@ -36,10 +35,6 @@ struct blk_queue_tags;#define SG_NONE 0#define SG_ALL SCSI_MAX_SG_SEGMENTS -#define MODE_UNKNOWN 0x00 -#define MODE_INITIATOR 0x01 -#define MODE_TARGET 0x02 -#define DISABLE_CLUSTERING 0#define ENABLE_CLUSTERING 1
@@ -84,7 +79,6 @@ struct scsi_host_template {*/ int (* ioctl)(struct scsi_device *dev,int cmd,void __user *arg); -#ifdef CONFIG_COMPAT /* * Compat handler. Handle 32bit ABI.
@@ -130,27 +124,6 @@ struct scsi_host_template {int (* queuecommand)(struct Scsi_Host *,struct scsi_cmnd *);/* -* The transfer functions are used to queue a scsi command to -* the LLD. When the driver is finished processing the command -* the done callback is invoked. -* -* This is called to inform the LLD to transfer -* scsi_bufflen(cmd) bytes. scsi_sg_count(cmd) speciefies the -* number of scatterlist entried in the command and -* scsi_sglist(cmd) returns the scatterlist. -* -* return values: see queuecommand -* -* If the LLD accepts the cmd, it should set the result to an -* appropriate value when completed before calling the done function. -* -* STATUS: REQUIRED FOR TARGET DRIVERS -*/ -/* TODO: rename */ -int (* transfer_response)(struct scsi_cmnd *, -void (*done)(struct scsi_cmnd *)); - -/* * This is an error handling strategy routine. You don't need to * define one of these if you don't want to - there is a default * routine that is present that should work in most cases. For those
@@ -426,11 +399,6 @@ struct scsi_host_template {unsigned char present;/* -* This specifies the mode that a LLD supports. -*/ - unsigned supported_mode:2; - -/* * True if this host adapter uses unchecked DMA onto an ISA bus. */ unsigned unchecked_isa_dma:1;
@@ -627,7 +595,6 @@ struct Scsi_Host {*/ unsigned long cmd_serial_number; - unsigned active_mode:2; unsigned unchecked_isa_dma:1; unsigned use_clustering:1; unsigned use_blk_tcq:1;
include/scsi/scsi_tgt.h deleted +0 -21
@@ -1,21 +0,0 @@ -/* -* SCSI target definitions -*/ - -#include <linux/dma-mapping.h> - -struct Scsi_Host ; -struct scsi_cmnd ; -struct scsi_lun ; - -extern struct Scsi_Host *scsi_tgt_cmd_to_host (struct scsi_cmnd *); -extern int scsi_tgt_alloc_queue (struct Scsi_Host *); -extern void scsi_tgt_free_queue (struct Scsi_Host *); -extern int scsi_tgt_queue_command (struct scsi_cmnd *,u64 ,struct scsi_lun *,u64 ); -extern int scsi_tgt_tsk_mgmt_request (struct Scsi_Host *,u64 ,int ,u64 , -struct scsi_lun *,void *); -extern struct scsi_cmnd *scsi_host_get_command (struct Scsi_Host *, -enum dma_data_direction ,gfp_t ); -extern void scsi_host_put_command (struct Scsi_Host *,struct scsi_cmnd *); -extern int scsi_tgt_it_nexus_create (struct Scsi_Host *,u64 ,char *); -extern int scsi_tgt_it_nexus_destroy (struct Scsi_Host *,u64 );
include/scsi/scsi_tgt_if.h deleted +0 -108
108 lines not on this page · raw message
Signature · 1 line
1.7.1