mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-25 17:15:44 +00:00
Kernel: Use ProtectedValue for VirtualFileSystem::m_mounts
This is what VirtualFileSystem::m_lock was actually guarding, and wrapping it in a ProtectedValue makes it so much more obvious how it all works. :^)
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
#include <Kernel/FileSystem/UnveilNode.h>
|
||||
#include <Kernel/Forward.h>
|
||||
#include <Kernel/KResult.h>
|
||||
#include <Kernel/Locking/ProtectedValue.h>
|
||||
|
||||
namespace Kernel {
|
||||
|
||||
@@ -65,7 +66,6 @@ public:
|
||||
KResult mknod(StringView path, mode_t, dev_t, Custody& base);
|
||||
KResultOr<NonnullRefPtr<Custody>> open_directory(StringView path, Custody& base);
|
||||
|
||||
size_t mount_count() const { return m_mounts.size(); }
|
||||
void for_each_mount(Function<void(const Mount&)>) const;
|
||||
|
||||
InodeIdentifier root_inode_id() const;
|
||||
@@ -90,11 +90,10 @@ private:
|
||||
Mount* find_mount_for_host(InodeIdentifier);
|
||||
Mount* find_mount_for_guest(InodeIdentifier);
|
||||
|
||||
Mutex m_lock { "VFSLock" };
|
||||
|
||||
RefPtr<Inode> m_root_inode;
|
||||
Vector<Mount, 16> m_mounts;
|
||||
RefPtr<Custody> m_root_custody;
|
||||
|
||||
ProtectedValue<Vector<Mount, 16>> m_mounts;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user