MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / parse_proc_self_mountinfo

Function parse_proc_self_mountinfo

src/service/src/boot.rs:146–156  ·  view source on GitHub ↗

Parses /proc/self/mountinfo into vectors of Mountinfo objects, returning (v2_mounts, v1_mounts).

()

Source from the content-addressed store, hash-verified

144 /// Parses /proc/self/mountinfo into vectors of Mountinfo objects,
145 /// returning (v2_mounts, v1_mounts).
146 fn parse_proc_self_mountinfo() -> Option<(Vec<MountInfo>, Vec<MountInfo>)> {
147 let file = File::open("/proc/self/mountinfo").ok()?;
148 let file = BufReader::new(file);
149 Some(
150 file.lines()
151 .map_while(Result::ok)
152 .filter_map(MountInfo::from_line)
153 .filter(|mi| mi.fs_type == "cgroup" || mi.fs_type == "cgroup2")
154 .partition(|mi| mi.fs_type == "cgroup2"),
155 )
156 }
157
158 /// Represents a cgroup limits, with both memory and swap maximums if they
159 /// exist.

Callers 1

detect_limitsFunction · 0.70

Calls 3

partitionMethod · 0.80
okMethod · 0.45
filterMethod · 0.45

Tested by

no test coverage detected