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:
parent
735da58d44
commit
88ca12f037
4 changed files with 19 additions and 15 deletions
|
@ -38,19 +38,19 @@ KResultOr<FlatPtr> Process::do_statvfs(StringView path, statvfs* buf)
|
|||
|
||||
while (current_custody) {
|
||||
VirtualFileSystem::the().for_each_mount([&kernelbuf, ¤t_custody](auto& mount) {
|
||||
if (current_custody) {
|
||||
if (¤t_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 (¤t_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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue