mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 22:25:07 +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
|
@ -351,7 +351,8 @@ private:
|
|||
virtual KResult try_generate(KBufferBuilder& builder) override
|
||||
{
|
||||
JsonArraySerializer array { builder };
|
||||
VirtualFileSystem::the().for_each_mount([&array](auto& mount) {
|
||||
KResult result = KSuccess;
|
||||
VirtualFileSystem::the().for_each_mount([&array, &result](auto& mount) {
|
||||
auto& fs = mount.guest_fs();
|
||||
auto fs_object = array.add_object();
|
||||
fs_object.add("class_name", fs.class_name());
|
||||
|
@ -368,6 +369,8 @@ private:
|
|||
fs_object.add("source", static_cast<const FileBackedFileSystem&>(fs).file_description().absolute_path());
|
||||
else
|
||||
fs_object.add("source", "none");
|
||||
|
||||
return IterationDecision::Continue;
|
||||
});
|
||||
array.finish();
|
||||
return KSuccess;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue