[LTP] [PATCH 2/8] lapi: add struct xattr_args fallback

Petr Vorel pvorel@suse.cz
Fri Jan 31 09:36:53 CET 2025


Hi Andrea,

> Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.com>
> ---
>  configure.ac         |  1 +
>  include/lapi/xattr.h | 19 +++++++++++++++++++
>  2 files changed, 20 insertions(+)

> diff --git a/configure.ac b/configure.ac
> index 6992d75ca300ccc4cc21a45a916f6b3be1a3b8fe..eb1a966322313cf785c25af0f317700418186927 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -247,6 +247,7 @@ AC_CHECK_TYPES([struct cachestat_range],,,[#include <sys/mman.h>])
>  AC_CHECK_TYPES([struct cachestat],,,[#include <sys/mman.h>])
>  AC_CHECK_TYPES([struct mnt_id_req],,,[#include <linux/mount.h>])
>  AC_CHECK_TYPES([struct statmount],,,[#include <linux/mount.h>])
> +AC_CHECK_TYPES([struct xattr_args],,,[#include <linux/xattr.h>])

>  # Tools knobs

> diff --git a/include/lapi/xattr.h b/include/lapi/xattr.h
> new file mode 100644
> index 0000000000000000000000000000000000000000..b30b24ac0dce04ee225a7609e92fb7af8b545283
> --- /dev/null
> +++ b/include/lapi/xattr.h
> @@ -0,0 +1,19 @@
> +/* SPDX-License-Identifier: GPL-2.0-or-later */
> +/*
> + * Copyright (c) 2025 Linux Test Project
> + */
> +
> +#ifndef LAPI_XATTR_H__
> +#define LAPI_XATTR_H__

> +
> +#include <stdint.h>

Could you, please, move conditional include from tests to this lapi header?

#ifdef HAVE_LINUX_XATTR_H
# include <linux/xattr.h>
#endif

That's the way we agreed in the past (tests include just a lapi header, not a
kernel one).

Otherwise LGTM.

Reviewed-by: Petr Vorel <pvorel@suse.cz>

Kind regards,
Petr

> +
> +#ifndef STRUCT_XATTR_ARGS
> +struct xattr_args {
> +	void *value;
> +	uint32_t size;
> +	uint32_t flags;
> +};
> +#endif
> +
> +#endif /* LAPI_XATTR_H__ */


More information about the ltp mailing list