mirror of
https://github.com/hexagonal-sun/moss-kernel.git
synced 2026-02-07 13:02:11 -05:00
implement STATX_MNT_ID for sys_statx
This commit is contained in:
@@ -70,13 +70,13 @@ pub struct StatX {
|
||||
pub stx_btime: StatXTimestamp, // Creation time
|
||||
pub stx_ctime: StatXTimestamp, // Change time
|
||||
pub stx_mtime: StatXTimestamp, // Modification time
|
||||
pub stx_mnt_id: u64, // Mount ID
|
||||
|
||||
// Currently not supported on any current filesystems
|
||||
pub stx_rdev_major: u32, // Device major ID
|
||||
pub stx_rdev_minor: u32, // Device minor ID
|
||||
pub stx_dev_major: u32, // Filesystem major ID
|
||||
pub stx_dev_minor: u32, // Filesystem minor ID
|
||||
pub stx_mnt_id: u64, // Mount ID
|
||||
pub stx_dio_mem_align: u32, // Alignment of memory for direct I/O
|
||||
pub stx_dio_offset_align: u32, // Alignment of offset for direct I/O
|
||||
pub stx_subvol: u64, // Subvolume ID
|
||||
@@ -199,6 +199,11 @@ pub async fn sys_statx(
|
||||
stat_x.stx_btime = attr.btime.into();
|
||||
}
|
||||
|
||||
if mask.contains(StatXMask::STATX_MNT_ID) {
|
||||
stat_x.stx_mask |= StatXMask::STATX_MNT_ID.bits();
|
||||
stat_x.stx_mnt_id = attr.id.fs_id();
|
||||
}
|
||||
|
||||
stat_x.stx_attributes_mask = StatXAttr::STATX_ATTR_MOUNT_ROOT.bits();
|
||||
if VFS.is_mount_root(attr.id) {
|
||||
stat_x.stx_attributes |= StatXAttr::STATX_ATTR_MOUNT_ROOT.bits();
|
||||
|
||||
Reference in New Issue
Block a user