Add mount ID to statx

This corresponds to the Linux commit
fa2fcf4f1df1559a0a4ee0f46915b496cc2ebf60 ("statx: add mount ID").

Note that STATX_ALL is not modified to include this field, because it
has actually been deprecated in Linux and is now effectively defined as
equal to STATX_BASIC_STATS | STATX_BTIME (see Linux commit
581701b7efd60ba13d8a7eed60cbdd7fefaf6696, "uapi: deprecate STATX_ALL").

Because said commit fa2fcf4f1d is less than a year old, skip testing the
STATX_MNT_ID constant.

Signed-off-by: Max Reitz <mreitz@redhat.com>
This commit is contained in:
Max Reitz 2021-01-07 17:13:32 +01:00
parent d6fbe9b85a
commit 5b109dd882
2 changed files with 7 additions and 1 deletions

View File

@ -2656,6 +2656,9 @@ fn test_linux(target: &str) {
| "CAN_RAW_FILTER_MAX"
| "CAN_NPROTO" => true,
// FIXME: Requires recent kernel headers (5.8):
"STATX_MNT_ID" => true,
_ => false,
}
});

View File

@ -26,7 +26,9 @@ s! {
pub stx_rdev_minor: u32,
pub stx_dev_major: u32,
pub stx_dev_minor: u32,
__statx_pad2: [u64; 14],
pub stx_mnt_id: u64,
__statx_pad2: u64,
__statx_pad3: [u64; 12],
}
pub struct statx_timestamp {
@ -1171,6 +1173,7 @@ pub const STATX_SIZE: ::c_uint = 0x0200;
pub const STATX_BLOCKS: ::c_uint = 0x0400;
pub const STATX_BASIC_STATS: ::c_uint = 0x07ff;
pub const STATX_BTIME: ::c_uint = 0x0800;
pub const STATX_MNT_ID: ::c_uint = 0x1000;
pub const STATX_ALL: ::c_uint = 0x0fff;
pub const STATX__RESERVED: ::c_int = 0x80000000;
pub const STATX_ATTR_COMPRESSED: ::c_int = 0x0004;