Skip to content

Commit be0c2d4

Browse files
committed
Auto merge of #2024 - XanClic:statx-mount-id-v2, r=JohnTitor
Add mount ID to statx This mirrors the modifications to `include/uapi/linux/stat.h` by [Linux commit fa2fcf4f1df1559a0a4ee0f46915b496cc2ebf60 (“statx: add mount ID”)](https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=fa2fcf4f1df1559a0a4ee0f46915b496cc2ebf60). What changed in v2 (v1: #2023): * Skip testing the new `STATX_MNT_ID` constant, because it’s only part of Linux as of 5.8. That’s too new e.g. for Ubuntu 20.04.1 (with a kernel derived from 5.4), which is what’s used by the CI.
2 parents 5019e1d + 5b109dd commit be0c2d4

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

libc-test/build.rs

+3
Original file line numberDiff line numberDiff line change
@@ -2655,6 +2655,9 @@ fn test_linux(target: &str) {
26552655
| "CAN_RAW_FILTER_MAX"
26562656
| "CAN_NPROTO" => true,
26572657

2658+
// FIXME: Requires recent kernel headers (5.8):
2659+
"STATX_MNT_ID" => true,
2660+
26582661
_ => false,
26592662
}
26602663
});

src/unix/linux_like/linux/gnu/mod.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ s! {
1313
pub stx_uid: u32,
1414
pub stx_gid: u32,
1515
pub stx_mode: u16,
16-
pub __statx_pad1: [u16; 1],
16+
__statx_pad1: [u16; 1],
1717
pub stx_ino: u64,
1818
pub stx_size: u64,
1919
pub stx_blocks: u64,
@@ -26,7 +26,9 @@ s! {
2626
pub stx_rdev_minor: u32,
2727
pub stx_dev_major: u32,
2828
pub stx_dev_minor: u32,
29-
pub __statx_pad2: [u64; 14],
29+
pub stx_mnt_id: u64,
30+
__statx_pad2: u64,
31+
__statx_pad3: [u64; 12],
3032
}
3133

3234
pub struct statx_timestamp {
@@ -1171,6 +1173,7 @@ pub const STATX_SIZE: ::c_uint = 0x0200;
11711173
pub const STATX_BLOCKS: ::c_uint = 0x0400;
11721174
pub const STATX_BASIC_STATS: ::c_uint = 0x07ff;
11731175
pub const STATX_BTIME: ::c_uint = 0x0800;
1176+
pub const STATX_MNT_ID: ::c_uint = 0x1000;
11741177
pub const STATX_ALL: ::c_uint = 0x0fff;
11751178
pub const STATX__RESERVED: ::c_int = 0x80000000;
11761179
pub const STATX_ATTR_COMPRESSED: ::c_int = 0x0004;

0 commit comments

Comments
 (0)