1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 15:48:12 +00:00

Kernel: Enable early-returns from VFS::for_each_mount

This commit is contained in:
Ben Wiederhake 2021-10-29 23:28:25 +02:00 committed by Andreas Kling
parent 735da58d44
commit 88ca12f037
4 changed files with 19 additions and 15 deletions

View file

@ -38,19 +38,19 @@ KResultOr<FlatPtr> Process::do_statvfs(StringView path, statvfs* buf)
while (current_custody) {
VirtualFileSystem::the().for_each_mount([&kernelbuf, &current_custody](auto& mount) {
if (current_custody) {
if (&current_custody->inode() == &mount.guest()) {
int mountflags = mount.flags();
int flags = 0;
if (mountflags & MS_RDONLY)
flags = flags | ST_RDONLY;
if (mountflags & MS_NOSUID)
flags = flags | ST_NOSUID;
if (&current_custody->inode() == &mount.guest()) {
int mountflags = mount.flags();
int flags = 0;
if (mountflags & MS_RDONLY)
flags = flags | ST_RDONLY;
if (mountflags & MS_NOSUID)
flags = flags | ST_NOSUID;
kernelbuf.f_flag = flags;
current_custody = nullptr;
}
kernelbuf.f_flag = flags;
current_custody = nullptr;
return IterationDecision::Break;
}
return IterationDecision::Continue;
});
if (current_custody) {