Commit 4f731705 authored by Jens Axboe's avatar Jens Axboe

io_uring/fdinfo: get rid of unnecessary is_cqe32 variable

We already have the cq_shift, just use that to tell if we have doubly
sized CQEs or not.

While in there, cleanup the CQE32 vs normal CQE size printing.
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent c0dc995e
...@@ -62,10 +62,9 @@ static __cold void __io_uring_show_fdinfo(struct io_ring_ctx *ctx, ...@@ -62,10 +62,9 @@ static __cold void __io_uring_show_fdinfo(struct io_ring_ctx *ctx,
unsigned int cq_shift = 0; unsigned int cq_shift = 0;
unsigned int sq_entries, cq_entries; unsigned int sq_entries, cq_entries;
bool has_lock; bool has_lock;
bool is_cqe32 = (ctx->flags & IORING_SETUP_CQE32);
unsigned int i; unsigned int i;
if (is_cqe32) if (ctx->flags & IORING_SETUP_CQE32)
cq_shift = 1; cq_shift = 1;
/* /*
...@@ -102,16 +101,13 @@ static __cold void __io_uring_show_fdinfo(struct io_ring_ctx *ctx, ...@@ -102,16 +101,13 @@ static __cold void __io_uring_show_fdinfo(struct io_ring_ctx *ctx,
unsigned int entry = i + cq_head; unsigned int entry = i + cq_head;
struct io_uring_cqe *cqe = &r->cqes[(entry & cq_mask) << cq_shift]; struct io_uring_cqe *cqe = &r->cqes[(entry & cq_mask) << cq_shift];
if (!is_cqe32) { seq_printf(m, "%5u: user_data:%llu, res:%d, flag:%x",
seq_printf(m, "%5u: user_data:%llu, res:%d, flag:%x\n",
entry & cq_mask, cqe->user_data, cqe->res, entry & cq_mask, cqe->user_data, cqe->res,
cqe->flags); cqe->flags);
} else { if (cq_shift)
seq_printf(m, "%5u: user_data:%llu, res:%d, flag:%x, " seq_printf(m, ", extra1:%llu, extra2:%llu\n",
"extra1:%llu, extra2:%llu\n", cqe->big_cqe[0], cqe->big_cqe[1]);
entry & cq_mask, cqe->user_data, cqe->res, seq_printf(m, "\n");
cqe->flags, cqe->big_cqe[0], cqe->big_cqe[1]);
}
} }
/* /*
......
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