From: "Darrick J. Wong" <djwong@kernel.org>
To: Christoph Hellwig <hch@lst.de>
Cc: Zorro Lang <zlang@kernel.org>, fstests@vger.kernel.org
Subject: Re: [PATCH 1/5] statx.h: update to latest kernel UAPI
Date: Mon, 31 Aug 2026 10:12:51 -0700 [thread overview]
Message-ID: <20260831171251.GB839663@frogsfrogsfrogs> (raw)
In-Reply-To: <20260831065120.2578146-2-hch@lst.de>
On Mon, Aug 31, 2026 at 09:51:04AM +0300, Christoph Hellwig wrote:
> Update the localy provided statx definition to the kernel UAPI as of
> 7.3-rc1.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
Seems fine to me;
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
--D
> ---
> src/statx.h | 126 +++++++++++++++++++++++++++++++++++++++-------------
> 1 file changed, 96 insertions(+), 30 deletions(-)
>
> diff --git a/src/statx.h b/src/statx.h
> index bae1c86f6201..0a27bf030b1d 100644
> --- a/src/statx.h
> +++ b/src/statx.h
> @@ -95,44 +95,97 @@ struct statx_timestamp {
> */
> struct statx {
> /* 0x00 */
> - __u32 stx_mask; /* What results were written [uncond] */
> - __u32 stx_blksize; /* Preferred general I/O size [uncond] */
> - __u64 stx_attributes; /* Flags conveying information about the file [uncond] */
> + /* What results were written [uncond] */
> + __u32 stx_mask;
> +
> + /* Preferred general I/O size [uncond] */
> + __u32 stx_blksize;
> +
> + /* Flags conveying information about the file [uncond] */
> + __u64 stx_attributes;
> +
> /* 0x10 */
> - __u32 stx_nlink; /* Number of hard links */
> - __u32 stx_uid; /* User ID of owner */
> - __u32 stx_gid; /* Group ID of owner */
> - __u16 stx_mode; /* File mode */
> + /* Number of hard links */
> + __u32 stx_nlink;
> +
> + /* User ID of owner */
> + __u32 stx_uid;
> +
> + /* Group ID of owner */
> + __u32 stx_gid;
> +
> + /* File mode */
> + __u16 stx_mode;
> __u16 __spare0[1];
> +
> /* 0x20 */
> - __u64 stx_ino; /* Inode number */
> - __u64 stx_size; /* File size */
> - __u64 stx_blocks; /* Number of 512-byte blocks allocated */
> - __u64 stx_attributes_mask; /* Mask to show what's supported in stx_attributes */
> + /* Inode number */
> + __u64 stx_ino;
> +
> + /* File size */
> + __u64 stx_size;
> +
> + /* Number of 512-byte blocks allocated */
> + __u64 stx_blocks;
> +
> + /* Mask to show what's supported in stx_attributes */
> + __u64 stx_attributes_mask;
>
> /* 0x40 */
> - struct statx_timestamp stx_atime; /* Last access time */
> - struct statx_timestamp stx_btime; /* File creation time */
> - struct statx_timestamp stx_ctime; /* Last attribute change time */
> - struct statx_timestamp stx_mtime; /* Last data modification time */
> + /* Last access time */
> + struct statx_timestamp stx_atime;
> +
> + /* File creation time */
> + struct statx_timestamp stx_btime;
> +
> + /* Last attribute change time */
> + struct statx_timestamp stx_ctime;
> +
> + /* Last data modification time */
> + struct statx_timestamp stx_mtime;
> +
> /* 0x80 */
> - __u32 stx_rdev_major; /* Device ID of special file [if bdev/cdev] */
> + /* Device ID of special file [if bdev/cdev] */
> + __u32 stx_rdev_major;
> __u32 stx_rdev_minor;
> - __u32 stx_dev_major; /* ID of device containing file [uncond] */
> +
> + /* ID of device containing file [uncond] */
> + __u32 stx_dev_major;
> __u32 stx_dev_minor;
> +
> /* 0x90 */
> __u64 stx_mnt_id;
> - __u32 stx_dio_mem_align; /* Memory buffer alignment for direct I/O */
> - __u32 stx_dio_offset_align; /* File offset alignment for direct I/O */
> +
> + /* Memory buffer alignment for direct I/O */
> + __u32 stx_dio_mem_align;
> +
> + /* File offset alignment for direct I/O */
> + __u32 stx_dio_offset_align;
> +
> /* 0xa0 */
> - __u64 stx_subvol; /* Subvolume identifier */
> - __u32 stx_atomic_write_unit_min; /* Min atomic write unit in bytes */
> - __u32 stx_atomic_write_unit_max; /* Max atomic write unit in bytes */
> + /* Subvolume identifier */
> + __u64 stx_subvol;
> +
> + /* Min atomic write unit in bytes */
> + __u32 stx_atomic_write_unit_min;
> +
> + /* Max atomic write unit in bytes */
> + __u32 stx_atomic_write_unit_max;
> +
> /* 0xb0 */
> - __u32 stx_atomic_write_segments_max; /* Max atomic write segment count */
> - __u32 __spare1[1];
> - /* 0xb8 */
> - __u64 __spare3[9]; /* Spare space for future expansion */
> + /* Max atomic write segment count */
> + __u32 stx_atomic_write_segments_max;
> +
> + /* File offset alignment for direct I/O reads */
> + __u32 stx_dio_read_offset_align;
> +
> + /* Optimised max atomic write unit in bytes */
> + __u32 stx_atomic_write_unit_max_opt;
> + __u32 __spare2[1];
> +
> + /* 0xc0 */
> + __u64 __spare3[8]; /* Spare space for future expansion */
> +
> /* 0x100 */
> };
>
> @@ -162,19 +215,32 @@ struct statx {
> #define STATX_MNT_ID_UNIQUE 0x00004000U /* Want/got extended stx_mount_id */
> #define STATX_SUBVOL 0x00008000U /* Want/got stx_subvol */
> #define STATX_WRITE_ATOMIC 0x00010000U /* Want/got atomic_write_* fields */
> +#define STATX_DIO_READ_ALIGN 0x00020000U /* Want/got dio read alignment info */
>
> -#define STATX_ALL 0x00000fffU /* All currently supported flags */
> +#define STATX__RESERVED 0x80000000U /* Reserved for future struct statx expansion */
>
> +#ifndef __KERNEL__
> /*
> - * Attributes to be found in stx_attributes
> + * This is deprecated, and shall remain the same value in the future. To avoid
> + * confusion please use the equivalent (STATX_BASIC_STATS | STATX_BTIME)
> + * instead.
> + */
> +#define STATX_ALL 0x00000fffU
> +#endif
> +
> +/*
> + * Attributes to be found in stx_attributes and masked in stx_attributes_mask.
> *
> * These give information about the features or the state of a file that might
> * be of use to ordinary userspace programs such as GUIs or ls rather than
> * specialised tools.
> *
> - * Note that the flags marked [I] correspond to generic FS_IOC_FLAGS
> + * Note that the flags marked [I] correspond to the FS_IOC_SETFLAGS flags
> * semantically. Where possible, the numerical value is picked to correspond
> - * also.
> + * also. Note that the DAX attribute indicates that the file is in the CPU
> + * direct access state. It does not correspond to the per-inode flag that
> + * some filesystems support.
> + *
> */
> #define STATX_ATTR_COMPRESSED 0x00000004 /* [I] File is compressed by the fs */
> #define STATX_ATTR_IMMUTABLE 0x00000010 /* [I] File is marked immutable */
> --
> 2.53.0
>
>
next prev parent reply other threads:[~2026-08-31 17:12 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-31 6:51 actually exercise sub-block direct I/O reads Christoph Hellwig
2026-08-31 6:51 ` [PATCH 1/5] statx.h: update to latest kernel UAPI Christoph Hellwig
2026-08-31 17:12 ` Darrick J. Wong [this message]
2026-09-02 15:31 ` Zorro Lang
2026-08-31 6:51 ` [PATCH 2/5] min_dio_alignment: add a -r option to query read alignment Christoph Hellwig
2026-08-31 17:16 ` Darrick J. Wong
2026-09-02 16:26 ` Zorro Lang
2026-09-03 5:34 ` Christoph Hellwig
2026-09-03 13:39 ` Zorro Lang
2026-09-02 16:31 ` Zorro Lang
2026-08-31 6:51 ` [PATCH 3/5] generic/091: enable sub-block reads Christoph Hellwig
2026-08-31 17:19 ` Darrick J. Wong
2026-09-02 16:46 ` Zorro Lang
2026-09-03 5:34 ` Christoph Hellwig
2026-09-03 13:33 ` Zorro Lang
2026-09-02 16:39 ` Zorro Lang
2026-08-31 6:51 ` [PATCH 4/5] generic/263: " Christoph Hellwig
2026-08-31 17:19 ` Darrick J. Wong
2026-09-02 16:48 ` Zorro Lang
2026-08-31 6:51 ` [PATCH 5/5] generic/760: " Christoph Hellwig
2026-08-31 17:19 ` Darrick J. Wong
2026-09-02 16:49 ` Zorro Lang
-- strict thread matches above, loose matches on Subject: below --
2024-08-14 4:52 improve minalign handling v2 Christoph Hellwig
2024-08-14 4:52 ` [PATCH 1/5] statx.h: update to latest kernel UAPI Christoph Hellwig
2024-08-14 5:12 ` Darrick J. Wong
2024-08-13 7:34 improve minalign handling Christoph Hellwig
2024-08-13 7:35 ` [PATCH 1/5] statx.h: update to latest kernel UAPI Christoph Hellwig
2024-08-13 14:37 ` Darrick J. Wong
2024-08-13 14:54 ` Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260831171251.GB839663@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=fstests@vger.kernel.org \
--cc=hch@lst.de \
--cc=zlang@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.