tree-wide: statx() supports STATX_ATTR_MOUNT_ROOT since kernel 5.8

Our baseline on kernel is 5.10, hence we can unconditionally use it.
This commit is contained in:
Yu Watanabe
2026-01-13 10:21:04 +09:00
parent ec21e5c58e
commit a98a6eb95c
5 changed files with 38 additions and 177 deletions
+11
View File
@@ -572,3 +572,14 @@ mode_t inode_type_from_string(const char *s) {
return MODE_INVALID;
}
int statx_warn_mount_root(const struct statx *sx, int log_level) {
assert(sx);
/* The STATX_ATTR_MOUNT_ROOT flag is supported since kernel v5.8. */
if (!FLAGS_SET(sx->stx_attributes_mask, STATX_ATTR_MOUNT_ROOT))
return log_full_errno(log_level, SYNTHETIC_ERRNO(ENOSYS),
"statx() did not set STATX_ATTR_MOUNT_ROOT, running on an old kernel?");
return 0;
}