diff options
author | Bart Van Assche <bvanassche@acm.org> | 2014-02-20 17:20:57 -0500 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2014-03-15 13:19:25 -0400 |
commit | 27e9e0f12acb5a76c72c3eed31ad3336e1970717 (patch) | |
tree | 6a5d8e9b13e265e66aea805840bbd05bbec063fa /drivers/scsi/scsi_lib.c | |
parent | 613be1f626e602c6744101a003e8fc5c180e1af9 (diff) |
[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>
Diffstat (limited to 'drivers/scsi/scsi_lib.c')
-rw-r--r-- | drivers/scsi/scsi_lib.c | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index f8a8765a7979..eba8044d0b11 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c | |||
@@ -526,14 +526,9 @@ void scsi_next_command(struct scsi_cmnd *cmd) | |||
526 | struct scsi_device *sdev = cmd->device; | 526 | struct scsi_device *sdev = cmd->device; |
527 | struct request_queue *q = sdev->request_queue; | 527 | struct request_queue *q = sdev->request_queue; |
528 | 528 | ||
529 | /* need to hold a reference on the device before we let go of the cmd */ | ||
530 | get_device(&sdev->sdev_gendev); | ||
531 | |||
532 | scsi_put_command(cmd); | 529 | scsi_put_command(cmd); |
533 | put_device(&sdev->sdev_gendev); | ||
534 | scsi_run_queue(q); | 530 | scsi_run_queue(q); |
535 | 531 | ||
536 | /* ok to remove device now */ | ||
537 | put_device(&sdev->sdev_gendev); | 532 | put_device(&sdev->sdev_gendev); |
538 | } | 533 | } |
539 | 534 | ||