提交 27e9e0f1 编写于 作者: B Bart Van Assche 提交者: James Bottomley

[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: NBart Van Assche <bvanassche@acm.org>
Reviewed-by: NHannes Reinecke <hare@suse.de>
Signed-off-by: NChristoph Hellwig <hch@lst.de>
Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
上级 613be1f6
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册