Re: [PATCH V9 6/7] SCSI: allow to pass null rq to scsi_prep_state_check()

From: Bart Van Assche
Date: Fri Oct 13 2017 - 19:16:21 EST


On Sat, 2017-10-14 at 02:05 +0800, Ming Lei wrote:
> In the following patch, we will implement scsi_get_budget()
> which need to call scsi_prep_state_check() when rq isn't
> dequeued yet.

My understanding is that this change is only needed because scsi_mq_get_budget()
calls scsi_prep_state_check() with the req argument set to NULL. Since
scsi_prep_state_check() tests for sdev states other than SDEV_RUNNING and since
the purpose of this series is to optimize performance for the case SDEV_RUNNING
I'm not sure it's a good idea to make scsi_mq_get_budget() call
scsi_prep_state_check(). And if scsi_mq_get_budget() wouldn't call
scsi_prep_state_check() then this patch is not necessary.

Bart.