Skip to content

Commit

Permalink
configure: add __kernel_rwf_t check
Browse files Browse the repository at this point in the history
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
axboe committed Jan 8, 2019
1 parent e223901 commit 57fa61f
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 0 deletions.
20 changes: 20 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -2295,6 +2295,23 @@ if compile_prog "" "-lcunit" "CUnit"; then
fi
print_config "CUnit" "$cunit"

##########################################
# check for __kernel_rwf_t
__kernel_rwf_t="no"
cat > $TMPC << EOF
#include <linux/fs.h>
int main(int argc, char **argv)
{
__kernel_rwf_t x;
x = 0;
return x;
}
EOF
if compile_prog "" "" "__kernel_rwf_t"; then
__kernel_rwf_t="yes"
fi
print_config "__kernel_rwf_t" "$__kernel_rwf_t"

#############################################################################

if test "$wordsize" = "64" ; then
Expand Down Expand Up @@ -2563,6 +2580,9 @@ fi
if test "$cunit" = "yes" ; then
output_sym "CONFIG_HAVE_CUNIT"
fi
if test "$__kernel_rwf_t" = "yes"; then
output_sym "CONFIG_HAVE_KERNEL_RWF_T"
fi

echo "LIBS+=$LIBS" >> $config_host_mak
echo "GFIO_LIBS+=$GFIO_LIBS" >> $config_host_mak
Expand Down
1 change: 1 addition & 0 deletions engines/io_uring.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

#ifdef ARCH_HAVE_IOURING

#include "../lib/types.h"
#include "../os/io_uring.h"

struct io_sq_ring {
Expand Down
4 changes: 4 additions & 0 deletions lib/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,8 @@ typedef int bool;
#include <stdbool.h> /* IWYU pragma: export */
#endif

#if !defined(CONFIG_HAVE_KERNEL_RWF_T)
typedef int __kernel_rwf_t;
#endif

#endif
1 change: 1 addition & 0 deletions t/io_uring.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <sched.h>

#include "../arch/arch.h"
#include "../lib/types.h"
#include "../os/io_uring.h"

#define barrier() __asm__ __volatile__("": : :"memory")
Expand Down

0 comments on commit 57fa61f

Please sign in to comment.