aboutsummaryrefslogtreecommitdiffstats
path: root/block/blk-mq.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2021-11-17 07:14:03 +0100
committerJens Axboe <axboe@kernel.dk>2021-11-29 06:35:21 -0700
commit0d7a29a2b5eae30eff1e216badca76978a3de39f (patch)
treee23272711a88d0bfab838ba29bb507e34d6bbc87 /block/blk-mq.c
parentblock: move blk_dump_rq_flags to blk-mq.c (diff)
downloadlinux-dev-0d7a29a2b5eae30eff1e216badca76978a3de39f.tar.xz
linux-dev-0d7a29a2b5eae30eff1e216badca76978a3de39f.zip
block: move blk_print_req_error to blk-mq.c
This function is only used by the request completion path. Factor out a blk_status_to_str to keep blk_errors private in blk-core.c. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Link: https://lore.kernel.org/r/20211117061404.331732-11-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-mq.c')
-rw-r--r--block/blk-mq.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 2a4eff639036..00df1eb031c0 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -717,6 +717,19 @@ static void blk_account_io_completion(struct request *req, unsigned int bytes)
}
}
+static void blk_print_req_error(struct request *req, blk_status_t status)
+{
+ printk_ratelimited(KERN_ERR
+ "%s error, dev %s, sector %llu op 0x%x:(%s) flags 0x%x "
+ "phys_seg %u prio class %u\n",
+ blk_status_to_str(status),
+ req->rq_disk ? req->rq_disk->disk_name : "?",
+ blk_rq_pos(req), req_op(req), blk_op_str(req_op(req)),
+ req->cmd_flags & ~REQ_OP_MASK,
+ req->nr_phys_segments,
+ IOPRIO_PRIO_CLASS(req->ioprio));
+}
+
/**
* blk_update_request - Complete multiple bytes without completing the request
* @req: the request being processed