On 2025-04-15 22:21:34, Darrick J. Wong wrote: > From: Darrick J. Wong <djwong@xxxxxxxxxx> > > Add all the new statx fields that have accumulated for the past couple > of years. > > Signed-off-by: "Darrick J. Wong" <djwong@xxxxxxxxxx> > --- > io/statx.h | 25 ++++++++++++++++++++++++- > io/stat.c | 5 +++++ > m4/package_libcdev.m4 | 2 +- > 3 files changed, 30 insertions(+), 2 deletions(-) > > diff --git a/io/statx.h b/io/statx.h > index 347f6d08210f83..273644f53cf1c4 100644 > --- a/io/statx.h > +++ b/io/statx.h > @@ -138,7 +138,10 @@ struct statx { > __u32 stx_atomic_write_unit_max; /* Max atomic write unit in bytes */ > /* 0xb0 */ > __u32 stx_atomic_write_segments_max; /* Max atomic write segment count */ > - __u32 __spare1[1]; > + > + /* File offset alignment for direct I/O reads */ > + __u32 stx_dio_read_offset_align; > + > /* 0xb8 */ > __u64 __spare3[9]; /* Spare space for future expansion */ > /* 0x100 */ > @@ -191,8 +194,28 @@ struct statx { > > #endif /* STATX_TYPE */ > > +#ifndef STATX_MNT_ID > +#define STATX_MNT_ID 0x00001000U /* Got stx_mnt_id */ > +#endif > + > +#ifndef STATX_DIOALIGN > +#define STATX_DIOALIGN 0x00002000U /* Want/got direct I/O alignment info */ > +#endif > + > +#ifndef STATX_MNT_ID_UNIQUE > +#define STATX_MNT_ID_UNIQUE 0x00004000U /* Want/got extended stx_mount_id */ > +#endif > + > +#ifndef STATX_SUBVOL > +#define STATX_SUBVOL 0x00008000U /* Want/got stx_subvol */ > +#endif > + > #ifndef STATX_WRITE_ATOMIC > #define STATX_WRITE_ATOMIC 0x00010000U /* Want/got atomic_write_* fields */ > #endif > > +#ifndef STATX_DIO_READ_ALIGN > +#define STATX_DIO_READ_ALIGN 0x00020000U /* Want/got dio read alignment info */ > +#endif > + > #endif /* XFS_IO_STATX_H */ > diff --git a/io/stat.c b/io/stat.c > index d27f916800c00a..b37b1a12b8b2fd 100644 > --- a/io/stat.c > +++ b/io/stat.c > @@ -365,9 +365,14 @@ dump_raw_statx(struct statx *stx) > printf("stat.rdev_minor = %u\n", stx->stx_rdev_minor); > printf("stat.dev_major = %u\n", stx->stx_dev_major); > printf("stat.dev_minor = %u\n", stx->stx_dev_minor); > + printf("stat.mnt_id = 0x%llu\n", (unsigned long long)stx->stx_mnt_id); > + printf("stat.dio_mem_align = %u\n", stx->stx_dio_mem_align); > + printf("stat.dio_offset_align = %u\n", stx->stx_dio_offset_align); > + printf("stat.subvol = 0x%llu\n", (unsigned long long)stx->stx_subvol); > printf("stat.atomic_write_unit_min = %u\n", stx->stx_atomic_write_unit_min); > printf("stat.atomic_write_unit_max = %u\n", stx->stx_atomic_write_unit_max); > printf("stat.atomic_write_segments_max = %u\n", stx->stx_atomic_write_segments_max); > + printf("stat.dio_read_offset_align = %u\n", stx->stx_dio_read_offset_align); > return 0; > } > > diff --git a/m4/package_libcdev.m4 b/m4/package_libcdev.m4 > index af9da8124dbdc8..61353d0aa9d536 100644 > --- a/m4/package_libcdev.m4 > +++ b/m4/package_libcdev.m4 > @@ -126,7 +126,7 @@ AC_DEFUN([AC_NEED_INTERNAL_FSCRYPT_POLICY_V2], > AC_DEFUN([AC_NEED_INTERNAL_STATX], > [ AC_CHECK_TYPE(struct statx, > [ > - AC_CHECK_MEMBER(struct statx.stx_atomic_write_unit_min, > + AC_CHECK_MEMBER(struct statx.stx_dio_read_offset_align, > , > need_internal_statx=yes, > [#include <linux/stat.h>] > Looks good to me Reviewed-by: Andrey Albershteyn <aalbersh@xxxxxxxxxx> -- - Andrey