]> git.karo-electronics.de Git - linux-beck.git/commitdiff
[SCSI] remove a useless get/put_device pair in scsi_next_command
authorBart Van Assche <bvanassche@acm.org>
Thu, 20 Feb 2014 22:20:57 +0000 (14:20 -0800)
committerJames Bottomley <JBottomley@Parallels.com>
Sat, 15 Mar 2014 17:19:25 +0000 (10:19 -0700)
Eliminate a get_device() / put_device() pair from scsi_next_command().
Both are atomic operations hence removing these slightly improves
performance.

[hch: slight changes due to different context]
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drivers/scsi/scsi_lib.c

index f8a8765a7979d1d2566c8c7123e89ee4bdcc40f4..eba8044d0b112627a22944cf3a92a5d63eb3c91c 100644 (file)
@@ -526,14 +526,9 @@ void scsi_next_command(struct scsi_cmnd *cmd)
        struct scsi_device *sdev = cmd->device;
        struct request_queue *q = sdev->request_queue;
 
-       /* need to hold a reference on the device before we let go of the cmd */
-       get_device(&sdev->sdev_gendev);
-
        scsi_put_command(cmd);
-       put_device(&sdev->sdev_gendev);
        scsi_run_queue(q);
 
-       /* ok to remove device now */
        put_device(&sdev->sdev_gendev);
 }