public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] xfs_io: catch statx fields up to 6.15
@ 2025-04-16  5:21 Darrick J. Wong
  2025-04-16  5:22 ` [PATCH 2/2] xfs_io: make statx mask parsing more generally useful Darrick J. Wong
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Darrick J. Wong @ 2025-04-16  5:21 UTC (permalink / raw)
  To: Andrey Albershteyn; +Cc: xfs, Christoph Hellwig

From: Darrick J. Wong <djwong@kernel.org>

Add all the new statx fields that have accumulated for the past couple
of years.

Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
---
 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>]

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2025-04-23 15:44 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-16  5:21 [PATCH 1/2] xfs_io: catch statx fields up to 6.15 Darrick J. Wong
2025-04-16  5:22 ` [PATCH 2/2] xfs_io: make statx mask parsing more generally useful Darrick J. Wong
2025-04-16  9:50   ` Andrey Albershteyn
2025-04-22  6:21   ` Christoph Hellwig
2025-04-23 15:33     ` Darrick J. Wong
2025-04-23 15:44       ` Christoph Hellwig
2025-04-16  9:15 ` [PATCH 1/2] xfs_io: catch statx fields up to 6.15 Andrey Albershteyn
2025-04-22  6:15 ` Christoph Hellwig
2025-04-23 15:31   ` Darrick J. Wong
2025-04-23 15:44     ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox