summaryrefslogtreecommitdiff
path: root/Kernel/FileSystem/VirtualFileSystem.h
diff options
context:
space:
mode:
authorSergey Bugaev <bugaevc@gmail.com>2020-01-11 18:05:24 +0300
committerAndreas Kling <awesomekling@gmail.com>2020-01-11 18:57:53 +0100
commit1e6ab0ed225eaa8585100526ce52f63914e4564d (patch)
treea952b873722c95b4d1b3713144efaa6ff3b3fdc0 /Kernel/FileSystem/VirtualFileSystem.h
parent4d77cdf9a805208c6f9993c657ae6c5a41a78372 (diff)
downloadserenity-1e6ab0ed225eaa8585100526ce52f63914e4564d.zip
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.
Diffstat (limited to 'Kernel/FileSystem/VirtualFileSystem.h')
-rw-r--r--Kernel/FileSystem/VirtualFileSystem.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/Kernel/FileSystem/VirtualFileSystem.h b/Kernel/FileSystem/VirtualFileSystem.h
index 2e8f92866d..38b5b54b4b 100644
--- a/Kernel/FileSystem/VirtualFileSystem.h
+++ b/Kernel/FileSystem/VirtualFileSystem.h
@@ -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;
};