Skip to content

Update statx to Linux 6.11 #1467

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/backend/libc/c.rs
Original file line number Diff line number Diff line change
Expand Up @@ -494,14 +494,15 @@ pub(super) use readwrite_pv64v2::{preadv64v2 as preadv2, pwritev64v2 as pwritev2
mod statx_flags {
pub(crate) use linux_raw_sys::general::{
STATX_ALL, STATX_ATIME, STATX_BASIC_STATS, STATX_BLOCKS, STATX_BTIME, STATX_CTIME,
STATX_DIOALIGN, STATX_GID, STATX_INO, STATX_MNT_ID, STATX_MODE, STATX_MTIME, STATX_NLINK,
STATX_SIZE, STATX_TYPE, STATX_UID,
STATX_DIOALIGN, STATX_GID, STATX_INO, STATX_MNT_ID, STATX_MNT_ID_UNIQUE, STATX_MODE,
STATX_MTIME, STATX_NLINK, STATX_SIZE, STATX_SUBVOL, STATX_TYPE, STATX_UID,
STATX_WRITE_ATOMIC,
};

pub(crate) use linux_raw_sys::general::{
STATX_ATTR_APPEND, STATX_ATTR_AUTOMOUNT, STATX_ATTR_COMPRESSED, STATX_ATTR_DAX,
STATX_ATTR_ENCRYPTED, STATX_ATTR_IMMUTABLE, STATX_ATTR_MOUNT_ROOT, STATX_ATTR_NODUMP,
STATX_ATTR_VERITY,
STATX_ATTR_VERITY, STATX_ATTR_WRITE_ATOMIC,
};
}
#[cfg(feature = "fs")]
Expand Down
7 changes: 4 additions & 3 deletions src/backend/linux_raw/c.rs
Original file line number Diff line number Diff line change
Expand Up @@ -357,14 +357,15 @@ pub(crate) use reboot_symbols::*;
mod statx_flags {
pub(crate) use linux_raw_sys::general::{
STATX_ALL, STATX_ATIME, STATX_BASIC_STATS, STATX_BLOCKS, STATX_BTIME, STATX_CTIME,
STATX_DIOALIGN, STATX_GID, STATX_INO, STATX_MNT_ID, STATX_MODE, STATX_MTIME, STATX_NLINK,
STATX_SIZE, STATX_TYPE, STATX_UID,
STATX_DIOALIGN, STATX_GID, STATX_INO, STATX_MNT_ID, STATX_MNT_ID_UNIQUE, STATX_MODE,
STATX_MTIME, STATX_NLINK, STATX_SIZE, STATX_SUBVOL, STATX_TYPE, STATX_UID,
STATX_WRITE_ATOMIC,
};

pub(crate) use linux_raw_sys::general::{
STATX_ATTR_APPEND, STATX_ATTR_AUTOMOUNT, STATX_ATTR_COMPRESSED, STATX_ATTR_DAX,
STATX_ATTR_ENCRYPTED, STATX_ATTR_IMMUTABLE, STATX_ATTR_MOUNT_ROOT, STATX_ATTR_NODUMP,
STATX_ATTR_VERITY,
STATX_ATTR_VERITY, STATX_ATTR_WRITE_ATOMIC,
};
}
#[cfg(any(
Expand Down
2 changes: 0 additions & 2 deletions src/fs/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,6 @@ mod tests {
#[cfg(not(libc))] // not in libc yet
check_renamed_struct_field!(Statx, statx, stx_atomic_write_segments_max);
#[cfg(linux_raw)]
check_renamed_struct_field!(Statx, statx, __spare1);
#[cfg(linux_raw)]
check_renamed_struct_field!(Statx, statx, __spare3);
}
}
Expand Down
14 changes: 13 additions & 1 deletion src/fs/statx.rs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix #1385.

This will auto close #1385. However it is only fixed when we update statx to 6.14 (STATX_DIO_READ_ALIGN).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm planning on adding that as well. I didn't so the CI would not error out, which ...... well, I forgot that libc doesn't have Linux 6.11 yet.

Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub struct Statx {
pub stx_atomic_write_unit_min: u32,
pub stx_atomic_write_unit_max: u32,
pub stx_atomic_write_segments_max: u32,
pub(crate) __spare1: [u32; 1],
pub stx_dio_read_offset_align: u32,
pub(crate) __spare3: [u64; 9],
}

Expand Down Expand Up @@ -114,6 +114,15 @@ bitflags! {
/// `STATX_DIOALIGN` (since Linux 6.1)
const DIOALIGN = c::STATX_DIOALIGN;

/// `STATX_MNT_ID_UNIQUE` (since Linux 6.8)
const MNT_ID_UNIQUE = c::STATX_MNT_ID_UNIQUE;

/// `STATX_SUBVOL` (since Linux 6.10)
const SUBVOL = c::STATX_SUBVOL;

/// `STATX_WRITE_ATOMIC ` (since Linux 6.11)
const WRITE_ATOMIC = c::STATX_WRITE_ATOMIC;

/// `STATX_ALL`
const ALL = c::STATX_ALL;

Expand Down Expand Up @@ -154,6 +163,9 @@ bitflags! {
/// `STATX_ATTR_DAX`
const DAX = c::STATX_ATTR_DAX as u64;

/// `STATX_ATTR_WRITE_ATOMIC`
const WRITE_ATOMIC = c::STATX_ATTR_WRITE_ATOMIC as u64;

/// <https://docs.rs/bitflags/*/bitflags/#externally-defined-flags>
const _ = !0;
}
Expand Down
Loading