Skip to content

Commit

Permalink
register: use do_register() for NAPI register/unregister
Browse files Browse the repository at this point in the history
This is the helper that should get used, so that it works regardless
of whether or not the ring fd itself is registered.

Link: #1133
Fixes: 3b25a80 ("liburing: add api to set napi busy poll settings")
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
axboe committed Apr 17, 2024
1 parent c1cee95 commit b74bdd0
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/register.c
Original file line number Diff line number Diff line change
Expand Up @@ -359,12 +359,10 @@ int io_uring_register_file_alloc_range(struct io_uring *ring,

int io_uring_register_napi(struct io_uring *ring, struct io_uring_napi *napi)
{
return __sys_io_uring_register(ring->ring_fd,
IORING_REGISTER_NAPI, napi, 1);
return do_register(ring, IORING_REGISTER_NAPI, napi, 1);
}

int io_uring_unregister_napi(struct io_uring *ring, struct io_uring_napi *napi)
{
return __sys_io_uring_register(ring->ring_fd,
IORING_UNREGISTER_NAPI, napi, 1);
return do_register(ring, IORING_UNREGISTER_NAPI, napi, 1);
}

0 comments on commit b74bdd0

Please sign in to comment.