Commit aeec7762 authored by Ming Lei's avatar Ming Lei Committed by Jens Axboe

scsi: allow passing in null rq to scsi_prep_state_check()

In the following patch, we will implement scsi_get_budget()
which need to call scsi_prep_state_check() when rq isn't
dequeued yet.
Signed-off-by: default avatarMing Lei <ming.lei@redhat.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent b347689f
...@@ -1301,7 +1301,7 @@ scsi_prep_state_check(struct scsi_device *sdev, struct request *req) ...@@ -1301,7 +1301,7 @@ scsi_prep_state_check(struct scsi_device *sdev, struct request *req)
/* /*
* If the devices is blocked we defer normal commands. * If the devices is blocked we defer normal commands.
*/ */
if (!(req->rq_flags & RQF_PREEMPT)) if (req && !(req->rq_flags & RQF_PREEMPT))
ret = BLKPREP_DEFER; ret = BLKPREP_DEFER;
break; break;
default: default:
...@@ -1310,7 +1310,7 @@ scsi_prep_state_check(struct scsi_device *sdev, struct request *req) ...@@ -1310,7 +1310,7 @@ scsi_prep_state_check(struct scsi_device *sdev, struct request *req)
* special commands. In particular any user initiated * special commands. In particular any user initiated
* command is not allowed. * command is not allowed.
*/ */
if (!(req->rq_flags & RQF_PREEMPT)) if (req && !(req->rq_flags & RQF_PREEMPT))
ret = BLKPREP_KILL; ret = BLKPREP_KILL;
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment