You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
blk-mq: switch ->queue_rq return value to blk_status_t
Use the same values for use for request completion errors as the return value from ->queue_rq. BLK_STS_RESOURCE is special cased to cause a requeue, and all the others are completed as-is. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@fb.com>
This commit is contained in:
committed by
Jens Axboe
parent
2a842acab1
commit
fc17b6534e
+4
-8
@@ -469,7 +469,7 @@ static int nbd_send_cmd(struct nbd_device *nbd, struct nbd_cmd *cmd, int index)
|
||||
nsock->pending = req;
|
||||
nsock->sent = sent;
|
||||
}
|
||||
return BLK_MQ_RQ_QUEUE_BUSY;
|
||||
return BLK_STS_RESOURCE;
|
||||
}
|
||||
dev_err_ratelimited(disk_to_dev(nbd->disk),
|
||||
"Send control failed (result %d)\n", result);
|
||||
@@ -510,7 +510,7 @@ send_pages:
|
||||
*/
|
||||
nsock->pending = req;
|
||||
nsock->sent = sent;
|
||||
return BLK_MQ_RQ_QUEUE_BUSY;
|
||||
return BLK_STS_RESOURCE;
|
||||
}
|
||||
dev_err(disk_to_dev(nbd->disk),
|
||||
"Send data failed (result %d)\n",
|
||||
@@ -798,7 +798,7 @@ out:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int nbd_queue_rq(struct blk_mq_hw_ctx *hctx,
|
||||
static blk_status_t nbd_queue_rq(struct blk_mq_hw_ctx *hctx,
|
||||
const struct blk_mq_queue_data *bd)
|
||||
{
|
||||
struct nbd_cmd *cmd = blk_mq_rq_to_pdu(bd->rq);
|
||||
@@ -822,13 +822,9 @@ static int nbd_queue_rq(struct blk_mq_hw_ctx *hctx,
|
||||
* appropriate.
|
||||
*/
|
||||
ret = nbd_handle_cmd(cmd, hctx->queue_num);
|
||||
if (ret < 0)
|
||||
ret = BLK_MQ_RQ_QUEUE_ERROR;
|
||||
if (!ret)
|
||||
ret = BLK_MQ_RQ_QUEUE_OK;
|
||||
complete(&cmd->send_complete);
|
||||
|
||||
return ret;
|
||||
return ret < 0 ? BLK_STS_IOERR : BLK_STS_OK;
|
||||
}
|
||||
|
||||
static int nbd_add_socket(struct nbd_device *nbd, unsigned long arg,
|
||||
|
||||
Reference in New Issue
Block a user