Skip to content

Commit

Permalink
Add setup.h include
Browse files Browse the repository at this point in the history
Some versions of clang warn that ____io_uring_queue_init_params() should
be static when compiling setup.c, since there's no external declaration
of it. We do have one in helpers.h, but add setup.h instead and include
that from both the helpers and setup side.

Fixes: 3401b06 ("setup: default to IORING_SETUP_NO_SQARRAY")
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
axboe committed Oct 18, 2023
1 parent 3401b06 commit b9cbcd5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "syscall.h"
#include "liburing.h"
#include "int_flags.h"
#include "setup.h"
#include "liburing/compat.h"
#include "liburing/io_uring.h"

Expand Down
9 changes: 9 additions & 0 deletions src/setup.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/* SPDX-License-Identifier: MIT */
#ifndef LIBURING_SETUP_H
#define LIBURING_SETUP_H

int __io_uring_queue_init_params(unsigned entries, struct io_uring *ring,
struct io_uring_params *p, void *buf,
size_t buf_size);

#endif
5 changes: 1 addition & 4 deletions test/helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ extern "C" {
#endif

#include "liburing.h"
#include "../src/setup.h"
#include <arpa/inet.h>

enum t_setup_ret {
Expand Down Expand Up @@ -87,10 +88,6 @@ bool t_probe_defer_taskrun(void);

unsigned __io_uring_flush_sq(struct io_uring *ring);

int __io_uring_queue_init_params(unsigned entries, struct io_uring *ring,
struct io_uring_params *p, void *buf,
size_t buf_size);

static inline int t_io_uring_init_sqarray(unsigned entries, struct io_uring *ring,
struct io_uring_params *p)
{
Expand Down

0 comments on commit b9cbcd5

Please sign in to comment.