]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
scsi: Introduce scsi_start_queue()
authorBart Van Assche <bart.vanassche@sandisk.com>
Fri, 2 Jun 2017 21:21:56 +0000 (14:21 -0700)
committerJack Vogel <jack.vogel@oracle.com>
Fri, 16 Feb 2018 23:06:06 +0000 (15:06 -0800)
This patch does not change any functionality.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Cc: Israel Rukshin <israelr@mellanox.com>
Cc: Max Gurtovoy <maxg@mellanox.com>
Cc: Benjamin Block <bblock@linux.vnet.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 27546768
(cherry picked from commit 66483a4a9f34427e3d6ec87d8e583f5d2a7cbb76)
Signed-off-by: Kyle Fortin <kyle.fortin@oracle.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/scsi_lib.c
drivers/scsi/scsi_priv.h

index 2ee399b9335d68e6755eb65844a1329118a6058e..ab4d4f022d812427488dc7e1185f605f2a48f9ca 100644 (file)
@@ -2971,6 +2971,20 @@ scsi_internal_device_block(struct scsi_device *sdev)
 }
 EXPORT_SYMBOL_GPL(scsi_internal_device_block);
  
+void scsi_start_queue(struct scsi_device *sdev)
+{
+       struct request_queue *q = sdev->request_queue;
+       unsigned long flags;
+
+       if (q->mq_ops) {
+               blk_mq_start_stopped_hw_queues(q, false);
+       } else {
+               spin_lock_irqsave(q->queue_lock, flags);
+               blk_start_queue(q);
+               spin_unlock_irqrestore(q->queue_lock, flags);
+       }
+}
+
 /**
  * scsi_internal_device_unblock - resume a device after a block request
  * @sdev:      device to resume
@@ -2991,9 +3005,6 @@ int
 scsi_internal_device_unblock(struct scsi_device *sdev,
                             enum scsi_device_state new_state)
 {
-       struct request_queue *q = sdev->request_queue; 
-       unsigned long flags;
-
        /*
         * Try to transition the scsi device to SDEV_RUNNING or one of the
         * offlined states and goose the device queue if successful.
@@ -3011,13 +3022,7 @@ scsi_internal_device_unblock(struct scsi_device *sdev,
                 sdev->sdev_state != SDEV_OFFLINE)
                return -EINVAL;
 
-       if (q->mq_ops) {
-               blk_mq_start_stopped_hw_queues(q, false);
-       } else {
-               spin_lock_irqsave(q->queue_lock, flags);
-               blk_start_queue(q);
-               spin_unlock_irqrestore(q->queue_lock, flags);
-       }
+       scsi_start_queue(sdev);
 
        return 0;
 }
index e3902fc66278d147b2e8c37c58211b336449b9f8..af6ff3aad8241307359f7b06c84710067a0cbed4 100644 (file)
@@ -87,6 +87,7 @@ extern void scsi_io_completion(struct scsi_cmnd *, unsigned int);
 extern void scsi_run_host_queues(struct Scsi_Host *shost);
 extern struct request_queue *scsi_alloc_queue(struct scsi_device *sdev);
 extern struct request_queue *scsi_mq_alloc_queue(struct scsi_device *sdev);
+extern void scsi_start_queue(struct scsi_device *sdev);
 extern int scsi_mq_setup_tags(struct Scsi_Host *shost);
 extern void scsi_mq_destroy_tags(struct Scsi_Host *shost);
 extern int scsi_init_queue(void);