Commit 4e54b849 authored by Bart Van Assche's avatar Bart Van Assche Committed by Jens Axboe

skd: Split skd_recover_requests()

This patch does not change any functionality but makes the blk-mq
conversion patch easier to read.
Signed-off-by: default avatarBart Van Assche <bart.vanassche@wdc.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Hannes Reinecke <hare@suse.de>
Cc: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 91f85da4
......@@ -2031,18 +2031,16 @@ static void skd_isr_fwstate(struct skd_device *skdev)
skd_skdev_state_to_str(skdev->state), skdev->state);
}
static void skd_recover_requests(struct skd_device *skdev)
static void skd_recover_request(struct skd_device *skdev,
struct skd_request_context *skreq)
{
int i;
for (i = 0; i < skdev->num_req_context; i++) {
struct skd_request_context *skreq = &skdev->skreq_table[i];
struct request *req = skreq->req;
if (skreq->state == SKD_REQ_STATE_BUSY) {
if (skreq->state != SKD_REQ_STATE_BUSY)
return;
skd_log_skreq(skdev, skreq, "recover");
SKD_ASSERT((skreq->id & SKD_ID_INCR) != 0);
SKD_ASSERT(req != NULL);
/* Release DMA resources for the request. */
......@@ -2050,12 +2048,19 @@ static void skd_recover_requests(struct skd_device *skdev)
skd_postop_sg_list(skdev, skreq);
skreq->req = NULL;
skreq->state = SKD_REQ_STATE_IDLE;
skreq->id += SKD_ID_INCR;
skd_end_request(skdev, req, BLK_STS_IOERR);
}
}
static void skd_recover_requests(struct skd_device *skdev)
{
int i;
for (i = 0; i < skdev->num_req_context; i++) {
struct skd_request_context *skreq = &skdev->skreq_table[i];
skd_recover_request(skdev, skreq);
}
for (i = 0; i < SKD_N_TIMEOUT_SLOT; i++)
......
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