Skip to content

Commit 9b1b58c

Browse files
committed
io_uring: remove sq/cq_off memset
We only have two reserved members we're not clearing, do so manually instead. This is in preparation for using one of these members for a new feature. Signed-off-by: Jens Axboe <[email protected]>
1 parent caec5eb commit 9b1b58c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

io_uring/io_uring.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3866,23 +3866,25 @@ static __cold int io_uring_create(unsigned entries, struct io_uring_params *p,
38663866
if (ret)
38673867
goto err;
38683868

3869-
memset(&p->sq_off, 0, sizeof(p->sq_off));
38703869
p->sq_off.head = offsetof(struct io_rings, sq.head);
38713870
p->sq_off.tail = offsetof(struct io_rings, sq.tail);
38723871
p->sq_off.ring_mask = offsetof(struct io_rings, sq_ring_mask);
38733872
p->sq_off.ring_entries = offsetof(struct io_rings, sq_ring_entries);
38743873
p->sq_off.flags = offsetof(struct io_rings, sq_flags);
38753874
p->sq_off.dropped = offsetof(struct io_rings, sq_dropped);
38763875
p->sq_off.array = (char *)ctx->sq_array - (char *)ctx->rings;
3876+
p->sq_off.resv1 = 0;
3877+
p->sq_off.resv2 = 0;
38773878

3878-
memset(&p->cq_off, 0, sizeof(p->cq_off));
38793879
p->cq_off.head = offsetof(struct io_rings, cq.head);
38803880
p->cq_off.tail = offsetof(struct io_rings, cq.tail);
38813881
p->cq_off.ring_mask = offsetof(struct io_rings, cq_ring_mask);
38823882
p->cq_off.ring_entries = offsetof(struct io_rings, cq_ring_entries);
38833883
p->cq_off.overflow = offsetof(struct io_rings, cq_overflow);
38843884
p->cq_off.cqes = offsetof(struct io_rings, cqes);
38853885
p->cq_off.flags = offsetof(struct io_rings, cq_flags);
3886+
p->cq_off.resv1 = 0;
3887+
p->cq_off.resv2 = 0;
38863888

38873889
p->features = IORING_FEAT_SINGLE_MMAP | IORING_FEAT_NODROP |
38883890
IORING_FEAT_SUBMIT_STABLE | IORING_FEAT_RW_CUR_POS |

0 commit comments

Comments
 (0)