Skip to content

Commit

Permalink
Update for new prep_futex_waitv() prototype
Browse files Browse the repository at this point in the history
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
axboe committed Sep 12, 2023
1 parent 25f595f commit 6651781
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
8 changes: 3 additions & 5 deletions src/include/liburing.h
Original file line number Diff line number Diff line change
Expand Up @@ -1183,12 +1183,10 @@ IOURINGINLINE void io_uring_prep_futex_wait(struct io_uring_sqe *sqe,
struct futex_waitv;
IOURINGINLINE void io_uring_prep_futex_waitv(struct io_uring_sqe *sqe,
struct futex_waitv *futex,
uint32_t nr_futex, uint64_t val,
uint64_t mask, uint32_t flags)
uint32_t nr_futex, uint32_t flags)
{
io_uring_prep_rw(IORING_OP_FUTEX_WAITV, sqe, 0, futex, nr_futex, val);
sqe->futex_flags = flags | 2; /* FLAGS_SIZE_32 */
sqe->addr3 = mask;
io_uring_prep_rw(IORING_OP_FUTEX_WAITV, sqe, 0, futex, nr_futex, 0);
sqe->futex_flags = flags;
}

/*
Expand Down
10 changes: 5 additions & 5 deletions test/futex.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ static int __test(struct io_uring *ring, int vectored, int async,

sqe = io_uring_get_sqe(ring);
if (vectored)
io_uring_prep_futex_waitv(sqe, fw, nfutex, 0, FUTEX_BITSET_MATCH_ANY, 0);
io_uring_prep_futex_waitv(sqe, fw, nfutex, 0);
else
io_uring_prep_futex_wait(sqe, futex, 0, FUTEX_BITSET_MATCH_ANY, 0);
if (async)
Expand Down Expand Up @@ -167,14 +167,14 @@ static int test_order(int vectored, int async)
if (!vectored)
io_uring_prep_futex_wait(sqe, futex, 0, FUTEX_BITSET_MATCH_ANY, 0);
else
io_uring_prep_futex_waitv(sqe, &fw, 1, 0, FUTEX_BITSET_MATCH_ANY, 0);
io_uring_prep_futex_waitv(sqe, &fw, 1, 0);
sqe->user_data = 1;

sqe = io_uring_get_sqe(&ring);
if (!vectored)
io_uring_prep_futex_wait(sqe, futex, 0, FUTEX_BITSET_MATCH_ANY, 0);
else
io_uring_prep_futex_waitv(sqe, &fw, 1, 0, FUTEX_BITSET_MATCH_ANY, 0);
io_uring_prep_futex_waitv(sqe, &fw, 1, 0);
sqe->user_data = 2;

io_uring_submit(&ring);
Expand Down Expand Up @@ -247,14 +247,14 @@ static int test_multi_wake(int vectored)
if (!vectored)
io_uring_prep_futex_wait(sqe, futex, 0, FUTEX_BITSET_MATCH_ANY, 0);
else
io_uring_prep_futex_waitv(sqe, &fw, 1, 0, FUTEX_BITSET_MATCH_ANY, 0);
io_uring_prep_futex_waitv(sqe, &fw, 1, 0);
sqe->user_data = 1;

sqe = io_uring_get_sqe(&ring);
if (!vectored)
io_uring_prep_futex_wait(sqe, futex, 0, FUTEX_BITSET_MATCH_ANY, 0);
else
io_uring_prep_futex_waitv(sqe, &fw, 1, 0, FUTEX_BITSET_MATCH_ANY, 0);
io_uring_prep_futex_waitv(sqe, &fw, 1, 0);
sqe->user_data = 2;

io_uring_submit(&ring);
Expand Down

0 comments on commit 6651781

Please sign in to comment.