[SCSI] remove a useless get/put_device pair in scsi_next_command

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>
This commit is contained in:
Bart Van Assche 2014-02-20 14:20:57 -08:00 committed by James Bottomley
parent 613be1f626
commit 27e9e0f12a
1 changed files with 0 additions and 5 deletions

View 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);
}