mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-01 20:17:13 +02:00
Kernel: Simplify VFS::Mount handling
No need to pass around RefPtr<>s and NonnullRefPtr<>s and no need to heap-allocate them. Also remove VFS::mount(NonnullRefPtr<FS>&&, StringView path) - it has been unused for a long time.
This commit is contained in:
committed by
Andreas Kling
parent
4d77cdf9a8
commit
1e6ab0ed22
Notes:
sideshowbarker
2024-07-19 10:12:02 +09:00
Author: https://github.com/bugaevc Commit: https://github.com/SerenityOS/serenity/commit/1e6ab0ed225 Pull-request: https://github.com/SerenityOS/serenity/pull/1053
@@ -41,7 +41,7 @@ class VFS {
|
||||
public:
|
||||
class Mount {
|
||||
public:
|
||||
Mount(RefPtr<Custody>&&, NonnullRefPtr<FS>&&);
|
||||
Mount(FS&, Custody* host_custody);
|
||||
|
||||
InodeIdentifier host() const;
|
||||
InodeIdentifier guest() const { return m_guest; }
|
||||
@@ -62,9 +62,8 @@ public:
|
||||
VFS();
|
||||
~VFS();
|
||||
|
||||
bool mount_root(NonnullRefPtr<FS>&&);
|
||||
KResult mount(NonnullRefPtr<FS>&&, StringView path);
|
||||
KResult mount(NonnullRefPtr<FS>&&, Custody& mount_point);
|
||||
bool mount_root(FS&);
|
||||
KResult mount(FS&, Custody& mount_point);
|
||||
KResult unmount(InodeIdentifier guest_inode_id);
|
||||
|
||||
KResultOr<NonnullRefPtr<FileDescription>> open(StringView path, int options, mode_t mode, Custody& base, Optional<UidAndGid> = {});
|
||||
@@ -110,7 +109,7 @@ private:
|
||||
Lock m_lock { "VFSLock" };
|
||||
|
||||
RefPtr<Inode> m_root_inode;
|
||||
NonnullOwnPtrVector<Mount> m_mounts;
|
||||
Vector<Mount> m_mounts;
|
||||
|
||||
RefPtr<Custody> m_root_custody;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user