pub struct Metadata {
pub mode: u32,
pub uid: u32,
pub gid: u32,
pub mtime: (u64, u32),
pub xattrs: Vec<(Vec<u8>, Vec<u8>)>,
}Expand description
The logical metadata of a node.
Fields§
§mode: u32The full st_mode of the node.
The writer ignores the file-type bits and takes the type from the
Node variant. It keeps the bits of mode & 0o7777: the permission
bits and the setuid, setgid, and sticky bits.
uid: u32The user id of the owner.
gid: u32The group id of the owner.
mtime: (u64, u32)The modification time as (seconds, nanoseconds).
xattrs: Vec<(Vec<u8>, Vec<u8>)>The extended attributes as (name, value) pairs.
The caller gives the logical names and values. The writer makes their
EROFS encoding (prefix indexing, ordering, sharing, and the name
filter). It escapes each trusted.overlay.X name as
trusted.overlay.overlay.X. The escape adds 8 bytes to the name suffix.
§Limits
Each limit is the range of an EROFS length or count field:
- A value is at most 65535 bytes.
- A name suffix is at most 255 bytes. The suffix is the part of the name after its EROFS prefix, and the limit applies after the escape.
- The xattr area of one inode is at most 262148 bytes. The number of attributes has no limit of its own.
If a name, a value, or an area is larger than its limit, the writer panics. The field in the image cannot state a larger size.
The writer shares an entry that repeats across inodes. One inode
references at most 128 shared entries, the limit that an observation of
the ostree command shows. If an inode has more repeated entries, it
references the first 128 in name order and keeps the others inline.