Re: [RFC PATCH] xfs_io: add linux madvise advice codes

From: Christoph Hellwig
Date: Sun Mar 17 2024 - 17:14:26 EST


> +#
> +# Check if asm/mman.h can be included
> +#
> +AC_DEFUN([AC_HAVE_KERNEL_MADVISE_FLAGS],
> + [ AC_MSG_CHECKING([for kernel madvise flags in asm/mman.h ])
> + AC_COMPILE_IFELSE(
> + [ AC_LANG_PROGRAM([[
> +#include <asm/mman.h>
> + ]], [[
> +int moo = MADV_COLLAPSE;
> + ]])
> + ], have_kernel_madvise=yes
> + AC_MSG_RESULT(yes),
> + AC_MSG_RESULT(no))
> + AC_SUBST(have_kernel_madvise)
> + ])
> +

I don't think we really need this check, as madvise and asm/mman.h
have been around forever. We can probably also drop most of the
actual flag idefs, probably for everything older than MADV_WIPEONFORK.

The rest looks good to me.