提交 867d8967 编写于 作者: J Jeffle Xu 提交者: Caspar Zhang

alinux: blk: export sector and len fields for iohang

fix #29612968

Sector address of all bios in a single request should be guaranteed to
be contiguous, except for DISCARD request. We could get the whole sector
range of the request by blk_rq_pos() and blk_rq_bytes() for normal read
/write requests, but here we still print the sector range of every bio
for code simpility. Since it is a low frequency operation, this design
will lead to no performance penalty.

Besides squash the 'if(bio)' and 'while(1)' into one single
'while(bio)'.
Signed-off-by: NJeffle Xu <jefflexu@linux.alibaba.com>
Reviewed-by: NJoseph Qi <joseph.qi@linux.alibaba.com>
上级 2044be44
......@@ -442,22 +442,20 @@ static void blk_mq_debugfs_rq_hang_show(struct seq_file *m, struct request *rq)
seq_printf(m, ", .current_time=%llu", ktime_get_ns());
bio = rq->bio;
if (bio) {
while (1) {
seq_printf(m, ", .bio = %px", bio);
seq_puts(m, ", .bio_pages = { ");
bio_for_each_segment_all(bvec, bio, i) {
struct page *page = bvec->bv_page;
if (!page)
continue;
seq_printf(m, "%px ", page);
}
seq_puts(m, "}");
bio = bio->bi_next;
if (bio == NULL)
break;
while (bio) {
seq_printf(m, ", .bio = %px", bio);
seq_printf(m, ", .sector = %lu, .len=%u",
bio->bi_iter.bi_sector, bio->bi_iter.bi_size);
seq_puts(m, ", .bio_pages = { ");
bio_for_each_segment_all(bvec, bio, i) {
struct page *page = bvec->bv_page;
if (!page)
continue;
seq_printf(m, "%px ", page);
}
seq_puts(m, "}");
bio = bio->bi_next;
}
if (mq_ops->show_rq)
mq_ops->show_rq(m, rq);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册