]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_io: catch statx fields up to 6.15
authorDarrick J. Wong <djwong@kernel.org>
Thu, 24 Apr 2025 21:53:08 +0000 (14:53 -0700)
committerAndrey Albershteyn <aalbersh@kernel.org>
Mon, 28 Apr 2025 10:56:58 +0000 (12:56 +0200)
Add all the new statx fields and flags that have accumulated for the
past couple of years so they all print now.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: John Garry <john.g.garry@oracle.com>
Reviewed-by: Andrey Albershteyn <aalbersh@kernel.org>
io/stat.c
io/statx.h
m4/package_libcdev.m4

index d27f916800c00a636b813ad2c286c35ed0804e42..b37b1a12b8b2fdd5beb2d4fe900e797f0c68879c 100644 (file)
--- 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;
 }
 
index 347f6d08210f83521947072352e7b05af15f8b74..273644f53cf1c4bceb1342e37d2de71ebc7d8c00 100644 (file)
@@ -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 */
index af9da8124dbdc8b8a5e3426a22819d9830f25af8..61353d0aa9d536971bd63b5c8a38777e4491f256 100644 (file)
@@ -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>]