1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 07:28:11 +00:00

Kernel: Include absolute paths of mount points in /proc/mounts

This commit is contained in:
Andreas Kling 2019-01-31 06:13:55 +01:00
parent 34e745b0b4
commit fc0b63ca3c
4 changed files with 20 additions and 6 deletions

View file

@ -208,15 +208,20 @@ ByteBuffer procfs$dmesg(SynthFSInode&)
ByteBuffer procfs$mounts(SynthFSInode&)
{
InterruptDisabler disabler;
// FIXME: This is obviously racy against the VFS mounts changing.
StringBuilder builder;
VFS::the().for_each_mount([&builder] (auto& mount) {
auto& fs = mount.guest_fs();
builder.appendf("%s @ ", fs.class_name());
if (!mount.host().is_valid())
builder.appendf("/\n", fs.class_name());
else
builder.appendf("%u:%u\n", mount.host().fsid(), mount.host().index());
builder.appendf("/");
else {
builder.appendf("%u:%u", mount.host().fsid(), mount.host().index());
auto path = VFS::the().absolute_path(mount.host());
builder.append(' ');
builder.append(path);
}
builder.append('\n');
});
return builder.to_byte_buffer();
}
@ -401,5 +406,5 @@ bool ProcFS::initialize()
const char* ProcFS::class_name() const
{
return "procfs";
return "ProcFS";
}