diff options
Diffstat (limited to 'drivers/scsi/scsi_lib.c')
-rw-r--r-- | drivers/scsi/scsi_lib.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 22a7e4c47207..286ea983c9e3 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c | |||
@@ -1955,27 +1955,22 @@ static void scsi_mq_put_budget(struct blk_mq_hw_ctx *hctx) | |||
1955 | put_device(&sdev->sdev_gendev); | 1955 | put_device(&sdev->sdev_gendev); |
1956 | } | 1956 | } |
1957 | 1957 | ||
1958 | static blk_status_t scsi_mq_get_budget(struct blk_mq_hw_ctx *hctx) | 1958 | static bool scsi_mq_get_budget(struct blk_mq_hw_ctx *hctx) |
1959 | { | 1959 | { |
1960 | struct request_queue *q = hctx->queue; | 1960 | struct request_queue *q = hctx->queue; |
1961 | struct scsi_device *sdev = q->queuedata; | 1961 | struct scsi_device *sdev = q->queuedata; |
1962 | blk_status_t ret; | ||
1963 | |||
1964 | ret = prep_to_mq(scsi_prep_state_check(sdev, NULL)); | ||
1965 | if (ret == BLK_STS_RESOURCE || ret != BLK_STS_OK) | ||
1966 | return ret; | ||
1967 | 1962 | ||
1968 | if (!get_device(&sdev->sdev_gendev)) | 1963 | if (!get_device(&sdev->sdev_gendev)) |
1969 | goto out; | 1964 | goto out; |
1970 | if (!scsi_dev_queue_ready(q, sdev)) | 1965 | if (!scsi_dev_queue_ready(q, sdev)) |
1971 | goto out_put_device; | 1966 | goto out_put_device; |
1972 | 1967 | ||
1973 | return BLK_STS_OK; | 1968 | return true; |
1974 | 1969 | ||
1975 | out_put_device: | 1970 | out_put_device: |
1976 | put_device(&sdev->sdev_gendev); | 1971 | put_device(&sdev->sdev_gendev); |
1977 | out: | 1972 | out: |
1978 | return BLK_STS_RESOURCE; | 1973 | return false; |
1979 | } | 1974 | } |
1980 | 1975 | ||
1981 | static blk_status_t scsi_queue_rq(struct blk_mq_hw_ctx *hctx, | 1976 | static blk_status_t scsi_queue_rq(struct blk_mq_hw_ctx *hctx, |