提交 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,9 +442,10 @@ static void blk_mq_debugfs_rq_hang_show(struct seq_file *m, struct request *rq) ...@@ -442,9 +442,10 @@ static void blk_mq_debugfs_rq_hang_show(struct seq_file *m, struct request *rq)
seq_printf(m, ", .current_time=%llu", ktime_get_ns()); seq_printf(m, ", .current_time=%llu", ktime_get_ns());
bio = rq->bio; bio = rq->bio;
if (bio) { while (bio) {
while (1) {
seq_printf(m, ", .bio = %px", 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 = { "); seq_puts(m, ", .bio_pages = { ");
bio_for_each_segment_all(bvec, bio, i) { bio_for_each_segment_all(bvec, bio, i) {
struct page *page = bvec->bv_page; struct page *page = bvec->bv_page;
...@@ -455,9 +456,6 @@ static void blk_mq_debugfs_rq_hang_show(struct seq_file *m, struct request *rq) ...@@ -455,9 +456,6 @@ static void blk_mq_debugfs_rq_hang_show(struct seq_file *m, struct request *rq)
} }
seq_puts(m, "}"); seq_puts(m, "}");
bio = bio->bi_next; bio = bio->bi_next;
if (bio == NULL)
break;
}
} }
if (mq_ops->show_rq) if (mq_ops->show_rq)
mq_ops->show_rq(m, rq); mq_ops->show_rq(m, rq);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册