scsi: core: Remove cmd_list functionality
authorHannes Reinecke <hare@suse.de>
Fri, 28 Feb 2020 07:53:18 +0000 (08:53 +0100)
committerMartin K. Petersen <martin.petersen@oracle.com>
Sat, 29 Feb 2020 01:54:55 +0000 (20:54 -0500)
Remove cmd_list functionality; no users left.  With that the
scsi_put_command() becomes empty, so remove that one, too.

Link: https://lore.kernel.org/r/20200228075318.91255-14-hare@suse.de
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Bart van Assche <bvanassche@acm.org>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/scsi.c
drivers/scsi/scsi_error.c
drivers/scsi/scsi_lib.c
drivers/scsi/scsi_priv.h
drivers/scsi/scsi_scan.c
include/scsi/scsi_cmnd.h
include/scsi/scsi_device.h
include/scsi/scsi_host.h

index 4b9fdfa..56c24a7 100644 (file)
@@ -94,20 +94,6 @@ EXPORT_SYMBOL(scsi_logging_level);
 ASYNC_DOMAIN_EXCLUSIVE(scsi_sd_pm_domain);
 EXPORT_SYMBOL(scsi_sd_pm_domain);
 
-/**
- * scsi_put_command - Free a scsi command block
- * @cmd: command block to free
- *
- * Returns:    Nothing.
- *
- * Notes:      The command must not belong to any lists.
- */
-void scsi_put_command(struct scsi_cmnd *cmd)
-{
-       scsi_del_cmd_from_list(cmd);
-       BUG_ON(delayed_work_pending(&cmd->abort_work));
-}
-
 #ifdef CONFIG_SCSI_LOGGING
 void scsi_log_send(struct scsi_cmnd *cmd)
 {
index ae2fa17..978be16 100644 (file)
@@ -2412,7 +2412,6 @@ scsi_ioctl_reset(struct scsi_device *dev, int __user *arg)
        wake_up(&shost->host_wait);
        scsi_run_host_queues(shost);
 
-       scsi_put_command(scmd);
        kfree(rq);
 
 out_put_autopm_host:
index a48a572..258a428 100644 (file)
@@ -562,7 +562,6 @@ static void scsi_mq_uninit_cmd(struct scsi_cmnd *cmd)
 {
        scsi_mq_free_sgtables(cmd);
        scsi_uninit_cmd(cmd);
-       scsi_del_cmd_from_list(cmd);
 }
 
 /* Returns false when no more bytes to process, true if there are more */
@@ -1098,35 +1097,6 @@ static void scsi_cleanup_rq(struct request *rq)
        }
 }
 
-/* Add a command to the list used by the aacraid and dpt_i2o drivers */
-void scsi_add_cmd_to_list(struct scsi_cmnd *cmd)
-{
-       struct scsi_device *sdev = cmd->device;
-       struct Scsi_Host *shost = sdev->host;
-       unsigned long flags;
-
-       if (shost->use_cmd_list) {
-               spin_lock_irqsave(&sdev->list_lock, flags);
-               list_add_tail(&cmd->list, &sdev->cmd_list);
-               spin_unlock_irqrestore(&sdev->list_lock, flags);
-       }
-}
-
-/* Remove a command from the list used by the aacraid and dpt_i2o drivers */
-void scsi_del_cmd_from_list(struct scsi_cmnd *cmd)
-{
-       struct scsi_device *sdev = cmd->device;
-       struct Scsi_Host *shost = sdev->host;
-       unsigned long flags;
-
-       if (shost->use_cmd_list) {
-               spin_lock_irqsave(&sdev->list_lock, flags);
-               BUG_ON(list_empty(&cmd->list));
-               list_del_init(&cmd->list);
-               spin_unlock_irqrestore(&sdev->list_lock, flags);
-       }
-}
-
 /* Called after a request has been started. */
 void scsi_init_command(struct scsi_device *dev, struct scsi_cmnd *cmd)
 {
@@ -1160,7 +1130,6 @@ void scsi_init_command(struct scsi_device *dev, struct scsi_cmnd *cmd)
        if (in_flight)
                __set_bit(SCMD_STATE_INFLIGHT, &cmd->state);
 
-       scsi_add_cmd_to_list(cmd);
 }
 
 static blk_status_t scsi_setup_scsi_cmnd(struct scsi_device *sdev,
index 25b0aaa..22b6585 100644 (file)
@@ -83,8 +83,6 @@ int scsi_eh_get_sense(struct list_head *work_q,
 int scsi_noretry_cmd(struct scsi_cmnd *scmd);
 
 /* scsi_lib.c */
-extern void scsi_add_cmd_to_list(struct scsi_cmnd *cmd);
-extern void scsi_del_cmd_from_list(struct scsi_cmnd *cmd);
 extern int scsi_maybe_unblock_host(struct scsi_device *sdev);
 extern void scsi_device_unbusy(struct scsi_device *sdev, struct scsi_cmnd *cmd);
 extern void scsi_queue_insert(struct scsi_cmnd *cmd, int reason);
index 058079f..f2437a7 100644 (file)
@@ -236,7 +236,6 @@ static struct scsi_device *scsi_alloc_sdev(struct scsi_target *starget,
        sdev->sdev_state = SDEV_CREATED;
        INIT_LIST_HEAD(&sdev->siblings);
        INIT_LIST_HEAD(&sdev->same_target_siblings);
-       INIT_LIST_HEAD(&sdev->cmd_list);
        INIT_LIST_HEAD(&sdev->starved_entry);
        INIT_LIST_HEAD(&sdev->event_list);
        spin_lock_init(&sdev->list_lock);
index a2849bb..80ac89e 100644 (file)
@@ -159,7 +159,6 @@ static inline struct scsi_driver *scsi_cmd_to_driver(struct scsi_cmnd *cmd)
        return *(struct scsi_driver **)cmd->request->rq_disk->private_data;
 }
 
-extern void scsi_put_command(struct scsi_cmnd *);
 extern void scsi_finish_command(struct scsi_cmnd *cmd);
 
 extern void *scsi_kmap_atomic_sg(struct scatterlist *sg, int sg_count,
index f8312a3..f146a45 100644 (file)
@@ -110,7 +110,6 @@ struct scsi_device {
        atomic_t device_blocked;        /* Device returned QUEUE_FULL. */
 
        spinlock_t list_lock;
-       struct list_head cmd_list;      /* queue of in use SCSI Command structures */
        struct list_head starved_entry;
        unsigned short queue_depth;     /* How deep of a queue we want */
        unsigned short max_queue_depth; /* max queue depth */
index eff1244..74dc7d4 100644 (file)
@@ -624,8 +624,6 @@ struct Scsi_Host {
        /* The controller does not support WRITE SAME */
        unsigned no_write_same:1;
 
-       unsigned use_cmd_list:1;
-
        /* Host responded with short (<36 bytes) INQUIRY result */
        unsigned short_inquiry:1;