diff --git a/Kernel/CoreDump.cpp b/Kernel/CoreDump.cpp index b6e2cab79f..0c9b131903 100644 --- a/Kernel/CoreDump.cpp +++ b/Kernel/CoreDump.cpp @@ -46,7 +46,7 @@ CoreDump::CoreDump(NonnullRefPtr process, NonnullRefPtr CoreDump::create_target_file(const Process& process, const String& output_path) { auto output_directory = KLexicalPath::dirname(output_path); - auto dump_directory = VFS::the().open_directory(output_directory, VFS::the().root_custody()); + auto dump_directory = VirtualFileSystem::the().open_directory(output_directory, VirtualFileSystem::the().root_custody()); if (dump_directory.is_error()) { dbgln("Can't find directory '{}' for core dump", output_directory); return nullptr; @@ -56,7 +56,7 @@ RefPtr CoreDump::create_target_file(const Process& process, con dbgln("Refusing to put core dump in sketchy directory '{}'", output_directory); return nullptr; } - auto fd_or_error = VFS::the().open( + auto fd_or_error = VirtualFileSystem::the().open( KLexicalPath::basename(output_path), O_CREAT | O_WRONLY | O_EXCL, S_IFREG, // We will enable reading from userspace when we finish generating the coredump file diff --git a/Kernel/FileSystem/FileDescription.cpp b/Kernel/FileSystem/FileDescription.cpp index ad767c0be0..7e60cb43d6 100644 --- a/Kernel/FileSystem/FileDescription.cpp +++ b/Kernel/FileSystem/FileDescription.cpp @@ -237,7 +237,7 @@ KResultOr FileDescription::get_dir_entries(UserOrKernelBuffer& output_bu return true; }; - KResult result = VFS::the().traverse_directory_inode(*m_inode, [&flush_stream_to_output_buffer, &stream, this](auto& entry) { + KResult result = VirtualFileSystem::the().traverse_directory_inode(*m_inode, [&flush_stream_to_output_buffer, &stream, this](auto& entry) { size_t serialized_size = sizeof(ino_t) + sizeof(u8) + sizeof(size_t) + sizeof(char) * entry.name.length(); if (serialized_size > stream.remaining()) { if (!flush_stream_to_output_buffer()) { diff --git a/Kernel/FileSystem/FileDescription.h b/Kernel/FileSystem/FileDescription.h index 20c678dfaf..4bd60f922f 100644 --- a/Kernel/FileSystem/FileDescription.h +++ b/Kernel/FileSystem/FileDescription.h @@ -113,7 +113,7 @@ public: OwnPtr& data() { return m_data; } - void set_original_inode(Badge, NonnullRefPtr&& inode) { m_inode = move(inode); } + void set_original_inode(Badge, NonnullRefPtr&& inode) { m_inode = move(inode); } KResult truncate(u64); @@ -124,7 +124,7 @@ public: FileBlockCondition& block_condition(); private: - friend class VFS; + friend class VirtualFileSystem; explicit FileDescription(File&); KResult attach(); diff --git a/Kernel/FileSystem/Inode.cpp b/Kernel/FileSystem/Inode.cpp index f0d8574955..d310b01ddb 100644 --- a/Kernel/FileSystem/Inode.cpp +++ b/Kernel/FileSystem/Inode.cpp @@ -86,7 +86,7 @@ KResultOr> Inode::resolve_as_link(Custody& base, RefPtrdata(), contents->size()); - return VFS::the().resolve_path(path, base, out_parent, options, symlink_recursion_level); + return VirtualFileSystem::the().resolve_path(path, base, out_parent, options, symlink_recursion_level); } Inode::Inode(FileSystem& fs, InodeIndex index) @@ -254,7 +254,7 @@ void Inode::did_delete_self() KResult Inode::prepare_to_write_data() { // FIXME: It's a poor design that filesystems are expected to call this before writing out data. - // We should funnel everything through an interface at the VFS layer so this can happen from a single place. + // We should funnel everything through an interface at the VirtualFileSystem layer so this can happen from a single place. Locker locker(m_lock); if (fs().is_readonly()) return EROFS; diff --git a/Kernel/FileSystem/Inode.h b/Kernel/FileSystem/Inode.h index 764241478b..29dc7d3bca 100644 --- a/Kernel/FileSystem/Inode.h +++ b/Kernel/FileSystem/Inode.h @@ -25,7 +25,7 @@ namespace Kernel { class Inode : public RefCounted , public Weakable { - friend class VFS; + friend class VirtualFileSystem; friend class FileSystem; public: diff --git a/Kernel/FileSystem/InodeFile.cpp b/Kernel/FileSystem/InodeFile.cpp index 7018aff72c..9e4ab77c52 100644 --- a/Kernel/FileSystem/InodeFile.cpp +++ b/Kernel/FileSystem/InodeFile.cpp @@ -125,14 +125,14 @@ KResult InodeFile::chown(FileDescription& description, uid_t uid, gid_t gid) { VERIFY(description.inode() == m_inode); VERIFY(description.custody()); - return VFS::the().chown(*description.custody(), uid, gid); + return VirtualFileSystem::the().chown(*description.custody(), uid, gid); } KResult InodeFile::chmod(FileDescription& description, mode_t mode) { VERIFY(description.inode() == m_inode); VERIFY(description.custody()); - return VFS::the().chmod(*description.custody(), mode); + return VirtualFileSystem::the().chmod(*description.custody(), mode); } } diff --git a/Kernel/FileSystem/VirtualFileSystem.cpp b/Kernel/FileSystem/VirtualFileSystem.cpp index e4d4f4d321..0441ef21e4 100644 --- a/Kernel/FileSystem/VirtualFileSystem.cpp +++ b/Kernel/FileSystem/VirtualFileSystem.cpp @@ -21,40 +21,40 @@ namespace Kernel { -static AK::Singleton s_the; +static AK::Singleton s_the; static constexpr int symlink_recursion_limit { 5 }; // FIXME: increase? static constexpr int root_mount_flags = MS_NODEV | MS_NOSUID | MS_RDONLY; -UNMAP_AFTER_INIT void VFS::initialize() +UNMAP_AFTER_INIT void VirtualFileSystem::initialize() { s_the.ensure_instance(); } -VFS& VFS::the() +VirtualFileSystem& VirtualFileSystem::the() { return *s_the; } -UNMAP_AFTER_INIT VFS::VFS() +UNMAP_AFTER_INIT VirtualFileSystem::VirtualFileSystem() { } -UNMAP_AFTER_INIT VFS::~VFS() +UNMAP_AFTER_INIT VirtualFileSystem::~VirtualFileSystem() { } -InodeIdentifier VFS::root_inode_id() const +InodeIdentifier VirtualFileSystem::root_inode_id() const { VERIFY(m_root_inode); return m_root_inode->identifier(); } -KResult VFS::mount(FileSystem& fs, Custody& mount_point, int flags) +KResult VirtualFileSystem::mount(FileSystem& fs, Custody& mount_point, int flags) { Locker locker(m_lock); auto& inode = mount_point.inode(); - dbgln("VFS: Mounting {} at {} (inode: {}) with flags {}", + dbgln("VirtualFileSystem: Mounting {} at {} (inode: {}) with flags {}", fs.class_name(), mount_point.try_create_absolute_path(), inode.identifier(), @@ -65,22 +65,22 @@ KResult VFS::mount(FileSystem& fs, Custody& mount_point, int flags) return KSuccess; } -KResult VFS::bind_mount(Custody& source, Custody& mount_point, int flags) +KResult VirtualFileSystem::bind_mount(Custody& source, Custody& mount_point, int flags) { Locker locker(m_lock); - dbgln("VFS: Bind-mounting {} at {}", source.try_create_absolute_path(), mount_point.try_create_absolute_path()); + dbgln("VirtualFileSystem: Bind-mounting {} at {}", source.try_create_absolute_path(), mount_point.try_create_absolute_path()); // FIXME: check that this is not already a mount point Mount mount { source.inode(), mount_point, flags }; m_mounts.append(move(mount)); return KSuccess; } -KResult VFS::remount(Custody& mount_point, int new_flags) +KResult VirtualFileSystem::remount(Custody& mount_point, int new_flags) { Locker locker(m_lock); - dbgln("VFS: Remounting {}", mount_point.try_create_absolute_path()); + dbgln("VirtualFileSystem: Remounting {}", mount_point.try_create_absolute_path()); Mount* mount = find_mount_for_guest(mount_point.inode()); if (!mount) @@ -90,32 +90,32 @@ KResult VFS::remount(Custody& mount_point, int new_flags) return KSuccess; } -KResult VFS::unmount(Inode& guest_inode) +KResult VirtualFileSystem::unmount(Inode& guest_inode) { Locker locker(m_lock); - dbgln("VFS: unmount called with inode {}", guest_inode.identifier()); + dbgln("VirtualFileSystem: unmount called with inode {}", guest_inode.identifier()); for (size_t i = 0; i < m_mounts.size(); ++i) { auto& mount = m_mounts.at(i); if (&mount.guest() == &guest_inode) { if (auto result = mount.guest_fs().prepare_to_unmount(); result.is_error()) { - dbgln("VFS: Failed to unmount!"); + dbgln("VirtualFileSystem: Failed to unmount!"); return result; } - dbgln("VFS: found fs {} at mount index {}! Unmounting...", mount.guest_fs().fsid(), i); + dbgln("VirtualFileSystem: found fs {} at mount index {}! Unmounting...", mount.guest_fs().fsid(), i); m_mounts.unstable_take(i); return KSuccess; } } - dbgln("VFS: Nothing mounted on inode {}", guest_inode.identifier()); + dbgln("VirtualFileSystem: Nothing mounted on inode {}", guest_inode.identifier()); return ENODEV; } -bool VFS::mount_root(FileSystem& fs) +bool VirtualFileSystem::mount_root(FileSystem& fs) { if (m_root_inode) { - dmesgln("VFS: mount_root can't mount another root"); + dmesgln("VirtualFileSystem: mount_root can't mount another root"); return false; } @@ -123,12 +123,12 @@ bool VFS::mount_root(FileSystem& fs) auto root_inode = fs.root_inode(); if (!root_inode->is_directory()) { - dmesgln("VFS: root inode ({}) for / is not a directory :(", root_inode->identifier()); + dmesgln("VirtualFileSystem: root inode ({}) for / is not a directory :(", root_inode->identifier()); return false; } m_root_inode = move(root_inode); - dmesgln("VFS: mounted root from {} ({})", fs.class_name(), static_cast(fs).file_description().absolute_path()); + dmesgln("VirtualFileSystem: mounted root from {} ({})", fs.class_name(), static_cast(fs).file_description().absolute_path()); m_mounts.append(move(mount)); @@ -139,7 +139,7 @@ bool VFS::mount_root(FileSystem& fs) return true; } -auto VFS::find_mount_for_host(Inode& inode) -> Mount* +auto VirtualFileSystem::find_mount_for_host(Inode& inode) -> Mount* { for (auto& mount : m_mounts) { if (mount.host() == &inode) @@ -148,7 +148,7 @@ auto VFS::find_mount_for_host(Inode& inode) -> Mount* return nullptr; } -auto VFS::find_mount_for_host(InodeIdentifier id) -> Mount* +auto VirtualFileSystem::find_mount_for_host(InodeIdentifier id) -> Mount* { for (auto& mount : m_mounts) { if (mount.host() && mount.host()->identifier() == id) @@ -157,7 +157,7 @@ auto VFS::find_mount_for_host(InodeIdentifier id) -> Mount* return nullptr; } -auto VFS::find_mount_for_guest(Inode& inode) -> Mount* +auto VirtualFileSystem::find_mount_for_guest(Inode& inode) -> Mount* { for (auto& mount : m_mounts) { if (&mount.guest() == &inode) @@ -166,7 +166,7 @@ auto VFS::find_mount_for_guest(Inode& inode) -> Mount* return nullptr; } -auto VFS::find_mount_for_guest(InodeIdentifier id) -> Mount* +auto VirtualFileSystem::find_mount_for_guest(InodeIdentifier id) -> Mount* { for (auto& mount : m_mounts) { if (mount.guest().identifier() == id) @@ -175,12 +175,12 @@ auto VFS::find_mount_for_guest(InodeIdentifier id) -> Mount* return nullptr; } -bool VFS::is_vfs_root(InodeIdentifier inode) const +bool VirtualFileSystem::is_vfs_root(InodeIdentifier inode) const { return inode == root_inode_id(); } -KResult VFS::traverse_directory_inode(Inode& dir_inode, Function callback) +KResult VirtualFileSystem::traverse_directory_inode(Inode& dir_inode, Function callback) { return dir_inode.traverse_as_directory([&](auto& entry) { InodeIdentifier resolved_inode; @@ -202,9 +202,9 @@ KResult VFS::traverse_directory_inode(Inode& dir_inode, Function VFS::lookup_metadata(StringView path, Custody& base, int options) +KResultOr VirtualFileSystem::lookup_metadata(StringView path, Custody& base, int options) { auto custody_or_error = resolve_path(path, base, nullptr, options); if (custody_or_error.is_error()) @@ -230,7 +230,7 @@ KResultOr VFS::lookup_metadata(StringView path, Custody& base, in return custody_or_error.value()->inode().metadata(); } -KResultOr> VFS::open(StringView path, int options, mode_t mode, Custody& base, Optional owner) +KResultOr> VirtualFileSystem::open(StringView path, int options, mode_t mode, Custody& base, Optional owner) { if ((options & O_CREAT) && (options & O_DIRECTORY)) return EINVAL; @@ -333,7 +333,7 @@ KResultOr> VFS::open(StringView path, int options return description; } -KResult VFS::mknod(StringView path, mode_t mode, dev_t dev, Custody& base) +KResult VirtualFileSystem::mknod(StringView path, mode_t mode, dev_t dev, Custody& base) { if (!is_regular_file(mode) && !is_block_device(mode) && !is_character_device(mode) && !is_fifo(mode) && !is_socket(mode)) return EINVAL; @@ -354,11 +354,11 @@ KResult VFS::mknod(StringView path, mode_t mode, dev_t dev, Custody& base) return EROFS; auto basename = KLexicalPath::basename(path); - dbgln("VFS::mknod: '{}' mode={} dev={} in {}", basename, mode, dev, parent_inode.identifier()); + dbgln("VirtualFileSystem::mknod: '{}' mode={} dev={} in {}", basename, mode, dev, parent_inode.identifier()); return parent_inode.create_child(basename, mode, dev, current_process->euid(), current_process->egid()).result(); } -KResultOr> VFS::create(StringView path, int options, mode_t mode, Custody& parent_custody, Optional owner) +KResultOr> VirtualFileSystem::create(StringView path, int options, mode_t mode, Custody& parent_custody, Optional owner) { auto basename = KLexicalPath::basename(path); auto parent_path = parent_custody.try_create_absolute_path(); @@ -382,7 +382,7 @@ KResultOr> VFS::create(StringView path, int optio if (parent_custody.is_readonly()) return EROFS; - dbgln_if(VFS_DEBUG, "VFS::create: '{}' in {}", basename, parent_inode.identifier()); + dbgln_if(VFS_DEBUG, "VirtualFileSystem::create: '{}' in {}", basename, parent_inode.identifier()); uid_t uid = owner.has_value() ? owner.value().uid : current_process->euid(); gid_t gid = owner.has_value() ? owner.value().gid : current_process->egid(); auto inode_or_error = parent_inode.create_child(basename, mode, 0, uid, gid); @@ -400,7 +400,7 @@ KResultOr> VFS::create(StringView path, int optio return description; } -KResult VFS::mkdir(StringView path, mode_t mode, Custody& base) +KResult VirtualFileSystem::mkdir(StringView path, mode_t mode, Custody& base) { // Unlike in basically every other case, where it's only the last // path component (the one being created) that is allowed not to @@ -425,11 +425,11 @@ KResult VFS::mkdir(StringView path, mode_t mode, Custody& base) return EROFS; auto basename = KLexicalPath::basename(path); - dbgln_if(VFS_DEBUG, "VFS::mkdir: '{}' in {}", basename, parent_inode.identifier()); + dbgln_if(VFS_DEBUG, "VirtualFileSystem::mkdir: '{}' in {}", basename, parent_inode.identifier()); return parent_inode.create_child(basename, S_IFDIR | mode, 0, current_process->euid(), current_process->egid()).result(); } -KResult VFS::access(StringView path, int mode, Custody& base) +KResult VirtualFileSystem::access(StringView path, int mode, Custody& base) { auto custody_or_error = resolve_path(path, base); if (custody_or_error.is_error()) @@ -455,7 +455,7 @@ KResult VFS::access(StringView path, int mode, Custody& base) return KSuccess; } -KResultOr> VFS::open_directory(StringView path, Custody& base) +KResultOr> VirtualFileSystem::open_directory(StringView path, Custody& base) { auto inode_or_error = resolve_path(path, base); if (inode_or_error.is_error()) @@ -469,7 +469,7 @@ KResultOr> VFS::open_directory(StringView path, Custody& return custody; } -KResult VFS::chmod(Custody& custody, mode_t mode) +KResult VirtualFileSystem::chmod(Custody& custody, mode_t mode) { auto& inode = custody.inode(); @@ -484,7 +484,7 @@ KResult VFS::chmod(Custody& custody, mode_t mode) return inode.chmod(mode); } -KResult VFS::chmod(StringView path, mode_t mode, Custody& base) +KResult VirtualFileSystem::chmod(StringView path, mode_t mode, Custody& base) { auto custody_or_error = resolve_path(path, base); if (custody_or_error.is_error()) @@ -493,7 +493,7 @@ KResult VFS::chmod(StringView path, mode_t mode, Custody& base) return chmod(custody, mode); } -KResult VFS::rename(StringView old_path, StringView new_path, Custody& base) +KResult VirtualFileSystem::rename(StringView old_path, StringView new_path, Custody& base) { RefPtr old_parent_custody; auto old_custody_or_error = resolve_path(old_path, base, &old_parent_custody, O_NOFOLLOW_NOERROR); @@ -566,7 +566,7 @@ KResult VFS::rename(StringView old_path, StringView new_path, Custody& base) return KSuccess; } -KResult VFS::chown(Custody& custody, uid_t a_uid, gid_t a_gid) +KResult VirtualFileSystem::chown(Custody& custody, uid_t a_uid, gid_t a_gid) { auto& inode = custody.inode(); auto metadata = inode.metadata(); @@ -592,10 +592,10 @@ KResult VFS::chown(Custody& custody, uid_t a_uid, gid_t a_gid) if (custody.is_readonly()) return EROFS; - dbgln_if(VFS_DEBUG, "VFS::chown(): inode {} <- uid={} gid={}", inode.identifier(), new_uid, new_gid); + dbgln_if(VFS_DEBUG, "VirtualFileSystem::chown(): inode {} <- uid={} gid={}", inode.identifier(), new_uid, new_gid); if (metadata.is_setuid() || metadata.is_setgid()) { - dbgln_if(VFS_DEBUG, "VFS::chown(): Stripping SUID/SGID bits from {}", inode.identifier()); + dbgln_if(VFS_DEBUG, "VirtualFileSystem::chown(): Stripping SUID/SGID bits from {}", inode.identifier()); if (auto result = inode.chmod(metadata.mode & ~(04000 | 02000)); result.is_error()) return result; } @@ -603,7 +603,7 @@ KResult VFS::chown(Custody& custody, uid_t a_uid, gid_t a_gid) return inode.chown(new_uid, new_gid); } -KResult VFS::chown(StringView path, uid_t a_uid, gid_t a_gid, Custody& base) +KResult VirtualFileSystem::chown(StringView path, uid_t a_uid, gid_t a_gid, Custody& base) { auto custody_or_error = resolve_path(path, base); if (custody_or_error.is_error()) @@ -629,7 +629,7 @@ static bool hard_link_allowed(const Inode& inode) return false; } -KResult VFS::link(StringView old_path, StringView new_path, Custody& base) +KResult VirtualFileSystem::link(StringView old_path, StringView new_path, Custody& base) { auto old_custody_or_error = resolve_path(old_path, base); if (old_custody_or_error.is_error()) @@ -665,7 +665,7 @@ KResult VFS::link(StringView old_path, StringView new_path, Custody& base) return parent_inode.add_child(old_inode, KLexicalPath::basename(new_path), old_inode.mode()); } -KResult VFS::unlink(StringView path, Custody& base) +KResult VirtualFileSystem::unlink(StringView path, Custody& base) { RefPtr parent_custody; auto custody_or_error = resolve_path(path, base, &parent_custody, O_NOFOLLOW_NOERROR | O_UNLINK_INTERNAL); @@ -701,7 +701,7 @@ KResult VFS::unlink(StringView path, Custody& base) return KSuccess; } -KResult VFS::symlink(StringView target, StringView linkpath, Custody& base) +KResult VirtualFileSystem::symlink(StringView target, StringView linkpath, Custody& base) { RefPtr parent_custody; auto existing_custody_or_error = resolve_path(linkpath, base, &parent_custody); @@ -719,7 +719,7 @@ KResult VFS::symlink(StringView target, StringView linkpath, Custody& base) return EROFS; auto basename = KLexicalPath::basename(linkpath); - dbgln_if(VFS_DEBUG, "VFS::symlink: '{}' (-> '{}') in {}", basename, target, parent_inode.identifier()); + dbgln_if(VFS_DEBUG, "VirtualFileSystem::symlink: '{}' (-> '{}') in {}", basename, target, parent_inode.identifier()); auto inode_or_error = parent_inode.create_child(basename, S_IFLNK | 0644, 0, current_process->euid(), current_process->egid()); if (inode_or_error.is_error()) return inode_or_error.error(); @@ -731,7 +731,7 @@ KResult VFS::symlink(StringView target, StringView linkpath, Custody& base) return KSuccess; } -KResult VFS::rmdir(StringView path, Custody& base) +KResult VirtualFileSystem::rmdir(StringView path, Custody& base) { RefPtr parent_custody; auto custody_or_error = resolve_path(path, base, &parent_custody); @@ -780,7 +780,7 @@ KResult VFS::rmdir(StringView path, Custody& base) return parent_inode.remove_child(KLexicalPath::basename(path)); } -VFS::Mount::Mount(FileSystem& guest_fs, Custody* host_custody, int flags) +VirtualFileSystem::Mount::Mount(FileSystem& guest_fs, Custody* host_custody, int flags) : m_guest(guest_fs.root_inode()) , m_guest_fs(guest_fs) , m_host_custody(host_custody) @@ -788,7 +788,7 @@ VFS::Mount::Mount(FileSystem& guest_fs, Custody* host_custody, int flags) { } -VFS::Mount::Mount(Inode& source, Custody& host_custody, int flags) +VirtualFileSystem::Mount::Mount(Inode& source, Custody& host_custody, int flags) : m_guest(source) , m_guest_fs(source.fs()) , m_host_custody(host_custody) @@ -796,45 +796,45 @@ VFS::Mount::Mount(Inode& source, Custody& host_custody, int flags) { } -String VFS::Mount::absolute_path() const +String VirtualFileSystem::Mount::absolute_path() const { if (!m_host_custody) return "/"; return m_host_custody->absolute_path(); } -Inode* VFS::Mount::host() +Inode* VirtualFileSystem::Mount::host() { if (!m_host_custody) return nullptr; return &m_host_custody->inode(); } -const Inode* VFS::Mount::host() const +const Inode* VirtualFileSystem::Mount::host() const { if (!m_host_custody) return nullptr; return &m_host_custody->inode(); } -void VFS::for_each_mount(Function callback) const +void VirtualFileSystem::for_each_mount(Function callback) const { for (auto& mount : m_mounts) { callback(mount); } } -void VFS::sync() +void VirtualFileSystem::sync() { FileSystem::sync(); } -Custody& VFS::root_custody() +Custody& VirtualFileSystem::root_custody() { return *m_root_custody; } -UnveilNode const& VFS::find_matching_unveiled_path(StringView path) +UnveilNode const& VirtualFileSystem::find_matching_unveiled_path(StringView path) { VERIFY(Process::current()->veil_state() != VeilState::None); auto& unveil_root = Process::current()->unveiled_paths(); @@ -843,7 +843,7 @@ UnveilNode const& VFS::find_matching_unveiled_path(StringView path) return unveil_root.traverse_until_last_accessible_node(path_parts.begin(), path_parts.end()); } -KResult VFS::validate_path_against_process_veil(Custody const& custody, int options) +KResult VirtualFileSystem::validate_path_against_process_veil(Custody const& custody, int options) { if (Process::current()->veil_state() == VeilState::None) return KSuccess; @@ -853,7 +853,7 @@ KResult VFS::validate_path_against_process_veil(Custody const& custody, int opti return validate_path_against_process_veil(absolute_path->view(), options); } -KResult VFS::validate_path_against_process_veil(StringView path, int options) +KResult VirtualFileSystem::validate_path_against_process_veil(StringView path, int options) { if (Process::current()->veil_state() == VeilState::None) return KSuccess; @@ -918,7 +918,7 @@ KResult VFS::validate_path_against_process_veil(StringView path, int options) return KSuccess; } -KResultOr> VFS::resolve_path(StringView path, Custody& base, RefPtr* out_parent, int options, int symlink_recursion_level) +KResultOr> VirtualFileSystem::resolve_path(StringView path, Custody& base, RefPtr* out_parent, int options, int symlink_recursion_level) { auto custody_or_error = resolve_path_without_veil(path, base, out_parent, options, symlink_recursion_level); if (custody_or_error.is_error()) @@ -946,7 +946,7 @@ static bool safe_to_follow_symlink(const Inode& inode, const InodeMetadata& pare return false; } -KResultOr> VFS::resolve_path_without_veil(StringView path, Custody& base, RefPtr* out_parent, int options, int symlink_recursion_level) +KResultOr> VirtualFileSystem::resolve_path_without_veil(StringView path, Custody& base, RefPtr* out_parent, int options, int symlink_recursion_level) { if (symlink_recursion_level >= symlink_recursion_limit) return ELOOP; diff --git a/Kernel/FileSystem/VirtualFileSystem.h b/Kernel/FileSystem/VirtualFileSystem.h index 87d07a9041..04c46fde2b 100644 --- a/Kernel/FileSystem/VirtualFileSystem.h +++ b/Kernel/FileSystem/VirtualFileSystem.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2020, Andreas Kling + * Copyright (c) 2018-2021, Andreas Kling * * SPDX-License-Identifier: BSD-2-Clause */ @@ -30,7 +30,7 @@ struct UidAndGid { gid_t gid; }; -class VFS { +class VirtualFileSystem { AK_MAKE_ETERNAL public: class Mount { @@ -59,10 +59,10 @@ public: }; static void initialize(); - static VFS& the(); + static VirtualFileSystem& the(); - VFS(); - ~VFS(); + VirtualFileSystem(); + ~VirtualFileSystem(); bool mount_root(FileSystem&); KResult mount(FileSystem&, Custody& mount_point, int flags); diff --git a/Kernel/Forward.h b/Kernel/Forward.h index 5a0f10b292..abe758997c 100644 --- a/Kernel/Forward.h +++ b/Kernel/Forward.h @@ -53,7 +53,7 @@ class TTY; class Thread; class UDPSocket; class UserOrKernelBuffer; -class VFS; +class VirtualFileSystem; class VMObject; class WaitQueue; class WorkQueue; diff --git a/Kernel/GlobalProcessExposed.cpp b/Kernel/GlobalProcessExposed.cpp index 54a4032b8b..56049e2709 100644 --- a/Kernel/GlobalProcessExposed.cpp +++ b/Kernel/GlobalProcessExposed.cpp @@ -339,7 +339,7 @@ private: virtual bool output(KBufferBuilder& builder) override { JsonArraySerializer array { builder }; - VFS::the().for_each_mount([&array](auto& mount) { + VirtualFileSystem::the().for_each_mount([&array](auto& mount) { auto& fs = mount.guest_fs(); auto fs_object = array.add_object(); fs_object.add("class_name", fs.class_name()); diff --git a/Kernel/KSyms.cpp b/Kernel/KSyms.cpp index 3bd05a9025..5ee477829d 100644 --- a/Kernel/KSyms.cpp +++ b/Kernel/KSyms.cpp @@ -166,7 +166,7 @@ void dump_backtrace() UNMAP_AFTER_INIT void load_kernel_symbol_table() { - auto result = VFS::the().open("/res/kernel.map", O_RDONLY, 0, VFS::the().root_custody()); + auto result = VirtualFileSystem::the().open("/res/kernel.map", O_RDONLY, 0, VirtualFileSystem::the().root_custody()); if (!result.is_error()) { auto description = result.value(); auto buffer = description->read_entire_file(); diff --git a/Kernel/Net/LocalSocket.cpp b/Kernel/Net/LocalSocket.cpp index c8674325f7..5d25631c8f 100644 --- a/Kernel/Net/LocalSocket.cpp +++ b/Kernel/Net/LocalSocket.cpp @@ -126,7 +126,7 @@ KResult LocalSocket::bind(Userspace user_address, socklen_t add mode_t mode = S_IFSOCK | (m_prebind_mode & 0777); UidAndGid owner { m_prebind_uid, m_prebind_gid }; - auto result = VFS::the().open(path, O_CREAT | O_EXCL | O_NOFOLLOW_NOERROR, mode, Process::current()->current_directory(), owner); + auto result = VirtualFileSystem::the().open(path, O_CREAT | O_EXCL | O_NOFOLLOW_NOERROR, mode, Process::current()->current_directory(), owner); if (result.is_error()) { if (result.error() == -EEXIST) return EADDRINUSE; @@ -168,7 +168,7 @@ KResult LocalSocket::connect(FileDescription& description, Userspacecurrent_directory()); + auto description_or_error = VirtualFileSystem::the().open(safe_address, O_RDWR, 0, Process::current()->current_directory()); if (description_or_error.is_error()) return ECONNREFUSED; diff --git a/Kernel/Process.cpp b/Kernel/Process.cpp index b7c5c7808a..59ee2b207c 100644 --- a/Kernel/Process.cpp +++ b/Kernel/Process.cpp @@ -153,7 +153,7 @@ RefPtr Process::create_user_process(RefPtr& first_thread, const } if (!cwd) - cwd = VFS::the().root_custody(); + cwd = VirtualFileSystem::the().root_custody(); auto process = Process::create(first_thread, parts.take_last(), uid, gid, parent_pid, false, move(cwd), nullptr, tty); if (!first_thread) @@ -488,7 +488,7 @@ siginfo_t Process::wait_info() Custody& Process::current_directory() { if (!m_cwd) - m_cwd = VFS::the().root_custody(); + m_cwd = VirtualFileSystem::the().root_custody(); return *m_cwd; } @@ -526,7 +526,7 @@ bool Process::dump_perfcore() VERIFY(is_dumpable()); VERIFY(m_perf_event_buffer); dbgln("Generating perfcore for pid: {}", pid().value()); - auto description_or_error = VFS::the().open(String::formatted("perfcore.{}", pid().value()), O_CREAT | O_EXCL, 0400, current_directory(), UidAndGid { uid(), gid() }); + auto description_or_error = VirtualFileSystem::the().open(String::formatted("perfcore.{}", pid().value()), O_CREAT | O_EXCL, 0400, current_directory(), UidAndGid { uid(), gid() }); if (description_or_error.is_error()) return false; auto& description = description_or_error.value(); @@ -742,7 +742,7 @@ void Process::FileDescriptionAndFlags::set(NonnullRefPtr&& desc Custody& Process::root_directory() { if (!m_root_directory) - m_root_directory = VFS::the().root_custody(); + m_root_directory = VirtualFileSystem::the().root_custody(); return *m_root_directory; } diff --git a/Kernel/Syscalls/access.cpp b/Kernel/Syscalls/access.cpp index 55b39dd1d8..a8dc4c1aa9 100644 --- a/Kernel/Syscalls/access.cpp +++ b/Kernel/Syscalls/access.cpp @@ -16,7 +16,7 @@ KResultOr Process::sys$access(Userspace user_path, size_t auto path = get_syscall_path_argument(user_path, path_length); if (path.is_error()) return path.error(); - return VFS::the().access(path.value()->view(), mode, current_directory()); + return VirtualFileSystem::the().access(path.value()->view(), mode, current_directory()); } } diff --git a/Kernel/Syscalls/chdir.cpp b/Kernel/Syscalls/chdir.cpp index bb016f9374..995d098890 100644 --- a/Kernel/Syscalls/chdir.cpp +++ b/Kernel/Syscalls/chdir.cpp @@ -17,7 +17,7 @@ KResultOr Process::sys$chdir(Userspace user_path, size_t p auto path = get_syscall_path_argument(user_path, path_length); if (path.is_error()) return path.error(); - auto directory_or_error = VFS::the().open_directory(path.value()->view(), current_directory()); + auto directory_or_error = VirtualFileSystem::the().open_directory(path.value()->view(), current_directory()); if (directory_or_error.is_error()) return directory_or_error.error(); m_cwd = *directory_or_error.value(); diff --git a/Kernel/Syscalls/chmod.cpp b/Kernel/Syscalls/chmod.cpp index 0e8be00b1e..387581b64c 100644 --- a/Kernel/Syscalls/chmod.cpp +++ b/Kernel/Syscalls/chmod.cpp @@ -17,7 +17,7 @@ KResultOr Process::sys$chmod(Userspace user_path, size_t p auto path = get_syscall_path_argument(user_path, path_length); if (path.is_error()) return path.error(); - return VFS::the().chmod(path.value()->view(), mode, current_directory()); + return VirtualFileSystem::the().chmod(path.value()->view(), mode, current_directory()); } KResultOr Process::sys$fchmod(int fd, mode_t mode) diff --git a/Kernel/Syscalls/chown.cpp b/Kernel/Syscalls/chown.cpp index ddc0203aca..33e155f12f 100644 --- a/Kernel/Syscalls/chown.cpp +++ b/Kernel/Syscalls/chown.cpp @@ -27,7 +27,7 @@ KResultOr Process::sys$chown(Userspace auto path = get_syscall_path_argument(params.path); if (path.is_error()) return path.error(); - return VFS::the().chown(path.value()->view(), params.uid, params.gid, current_directory()); + return VirtualFileSystem::the().chown(path.value()->view(), params.uid, params.gid, current_directory()); } } diff --git a/Kernel/Syscalls/chroot.cpp b/Kernel/Syscalls/chroot.cpp index cade89cee3..67ca084bdb 100644 --- a/Kernel/Syscalls/chroot.cpp +++ b/Kernel/Syscalls/chroot.cpp @@ -19,7 +19,7 @@ KResultOr Process::sys$chroot(Userspace user_path, size_t auto path = get_syscall_path_argument(user_path, path_length); if (path.is_error()) return path.error(); - auto directory_or_error = VFS::the().open_directory(path.value()->view(), current_directory()); + auto directory_or_error = VirtualFileSystem::the().open_directory(path.value()->view(), current_directory()); if (directory_or_error.is_error()) return directory_or_error.error(); auto directory = directory_or_error.value(); diff --git a/Kernel/Syscalls/execve.cpp b/Kernel/Syscalls/execve.cpp index 94ae1c373b..6c8b93424c 100644 --- a/Kernel/Syscalls/execve.cpp +++ b/Kernel/Syscalls/execve.cpp @@ -762,7 +762,7 @@ KResultOr> Process::find_elf_interpreter_for_executable( if (!interpreter_path.is_empty()) { dbgln_if(EXEC_DEBUG, "exec({}): Using program interpreter {}", path, interpreter_path); - auto interp_result = VFS::the().open(interpreter_path, O_EXEC, 0, current_directory()); + auto interp_result = VirtualFileSystem::the().open(interpreter_path, O_EXEC, 0, current_directory()); if (interp_result.is_error()) { dbgln("exec({}): Unable to open program interpreter {}", path, interpreter_path); return interp_result.error(); @@ -838,7 +838,7 @@ KResult Process::exec(String path, Vector arguments, Vector envi // * ET_EXEC binary that just gets loaded // * ET_DYN binary that requires a program interpreter // - auto file_or_error = VFS::the().open(path, O_EXEC, 0, current_directory()); + auto file_or_error = VirtualFileSystem::the().open(path, O_EXEC, 0, current_directory()); if (file_or_error.is_error()) return file_or_error.error(); auto description = file_or_error.release_value(); diff --git a/Kernel/Syscalls/inode_watcher.cpp b/Kernel/Syscalls/inode_watcher.cpp index af765c560e..1e8ca8c7bd 100644 --- a/Kernel/Syscalls/inode_watcher.cpp +++ b/Kernel/Syscalls/inode_watcher.cpp @@ -59,7 +59,7 @@ KResultOr Process::sys$inode_watcher_add_watch(Userspaceview(), current_directory()); + auto custody_or_error = VirtualFileSystem::the().resolve_path(path.value()->view(), current_directory()); if (custody_or_error.is_error()) return custody_or_error.error(); diff --git a/Kernel/Syscalls/link.cpp b/Kernel/Syscalls/link.cpp index 346a6c451b..a5c5142f75 100644 --- a/Kernel/Syscalls/link.cpp +++ b/Kernel/Syscalls/link.cpp @@ -22,7 +22,7 @@ KResultOr Process::sys$link(Userspace u auto new_path = copy_string_from_user(params.new_path); if (new_path.is_null()) return EFAULT; - return VFS::the().link(old_path, new_path, current_directory()); + return VirtualFileSystem::the().link(old_path, new_path, current_directory()); } KResultOr Process::sys$symlink(Userspace user_params) @@ -37,7 +37,7 @@ KResultOr Process::sys$symlink(Userspaceview(), linkpath.value()->view(), current_directory()); + return VirtualFileSystem::the().symlink(target.value()->view(), linkpath.value()->view(), current_directory()); } } diff --git a/Kernel/Syscalls/mkdir.cpp b/Kernel/Syscalls/mkdir.cpp index 9a7267daf3..7ad45bee0e 100644 --- a/Kernel/Syscalls/mkdir.cpp +++ b/Kernel/Syscalls/mkdir.cpp @@ -16,6 +16,6 @@ KResultOr Process::sys$mkdir(Userspace user_path, size_t p auto path = get_syscall_path_argument(user_path, path_length); if (path.is_error()) return path.error(); - return VFS::the().mkdir(path.value()->view(), mode & ~umask(), current_directory()); + return VirtualFileSystem::the().mkdir(path.value()->view(), mode & ~umask(), current_directory()); } } diff --git a/Kernel/Syscalls/mknod.cpp b/Kernel/Syscalls/mknod.cpp index a3c1ac23f0..a1625a7789 100644 --- a/Kernel/Syscalls/mknod.cpp +++ b/Kernel/Syscalls/mknod.cpp @@ -21,7 +21,7 @@ KResultOr Process::sys$mknod(Userspace auto path = get_syscall_path_argument(params.path); if (path.is_error()) return path.error(); - return VFS::the().mknod(path.value()->view(), params.mode & ~umask(), params.dev, current_directory()); + return VirtualFileSystem::the().mknod(path.value()->view(), params.mode & ~umask(), params.dev, current_directory()); } } diff --git a/Kernel/Syscalls/module.cpp b/Kernel/Syscalls/module.cpp index 182fe22ae1..209c7c3dc1 100644 --- a/Kernel/Syscalls/module.cpp +++ b/Kernel/Syscalls/module.cpp @@ -25,7 +25,7 @@ KResultOr Process::sys$module_load(Userspace user_path, si auto path = get_syscall_path_argument(user_path, path_length); if (path.is_error()) return path.error(); - auto description_or_error = VFS::the().open(path.value()->view(), O_RDONLY, 0, current_directory()); + auto description_or_error = VirtualFileSystem::the().open(path.value()->view(), O_RDONLY, 0, current_directory()); if (description_or_error.is_error()) return description_or_error.error(); auto& description = description_or_error.value(); diff --git a/Kernel/Syscalls/mount.cpp b/Kernel/Syscalls/mount.cpp index 3ae430484d..9220551e5f 100644 --- a/Kernel/Syscalls/mount.cpp +++ b/Kernel/Syscalls/mount.cpp @@ -42,7 +42,7 @@ KResultOr Process::sys$mount(Userspace else dbgln("mount {} @ {}", fs_type, target); - auto custody_or_error = VFS::the().resolve_path(target, current_directory()); + auto custody_or_error = VirtualFileSystem::the().resolve_path(target, current_directory()); if (custody_or_error.is_error()) return custody_or_error.error(); @@ -50,7 +50,7 @@ KResultOr Process::sys$mount(Userspace if (params.flags & MS_REMOUNT) { // We're not creating a new mount, we're updating an existing one! - return VFS::the().remount(target_custody, params.flags & ~MS_REMOUNT); + return VirtualFileSystem::the().remount(target_custody, params.flags & ~MS_REMOUNT); } if (params.flags & MS_BIND) { @@ -61,7 +61,7 @@ KResultOr Process::sys$mount(Userspace // We only support bind-mounting inodes, not arbitrary files. return ENODEV; } - return VFS::the().bind_mount(*description->custody(), target_custody, params.flags); + return VirtualFileSystem::the().bind_mount(*description->custody(), target_custody, params.flags); } RefPtr fs; @@ -106,7 +106,7 @@ KResultOr Process::sys$mount(Userspace return ENODEV; } - auto result = VFS::the().mount(fs.release_nonnull(), target_custody, params.flags); + auto result = VirtualFileSystem::the().mount(fs.release_nonnull(), target_custody, params.flags); if (!description.is_null()) dbgln("mount: successfully mounted {} on {}", description->absolute_path(), target); else @@ -125,12 +125,12 @@ KResultOr Process::sys$umount(Userspace user_mountpoint, s if (mountpoint.is_error()) return mountpoint.error(); - auto custody_or_error = VFS::the().resolve_path(mountpoint.value()->view(), current_directory()); + auto custody_or_error = VirtualFileSystem::the().resolve_path(mountpoint.value()->view(), current_directory()); if (custody_or_error.is_error()) return custody_or_error.error(); auto& guest_inode = custody_or_error.value()->inode(); - return VFS::the().unmount(guest_inode); + return VirtualFileSystem::the().unmount(guest_inode); } } diff --git a/Kernel/Syscalls/open.cpp b/Kernel/Syscalls/open.cpp index 5ab765653c..c0b0fd2c36 100644 --- a/Kernel/Syscalls/open.cpp +++ b/Kernel/Syscalls/open.cpp @@ -62,7 +62,7 @@ KResultOr Process::sys$open(Userspace u base = base_description->custody(); } - auto result = VFS::the().open(path.value()->view(), options, mode & ~umask(), *base); + auto result = VirtualFileSystem::the().open(path.value()->view(), options, mode & ~umask(), *base); if (result.is_error()) return result.error(); auto description = result.value(); diff --git a/Kernel/Syscalls/readlink.cpp b/Kernel/Syscalls/readlink.cpp index 4095bface6..cf6999f455 100644 --- a/Kernel/Syscalls/readlink.cpp +++ b/Kernel/Syscalls/readlink.cpp @@ -23,7 +23,7 @@ KResultOr Process::sys$readlink(Userspaceview(), O_RDONLY | O_NOFOLLOW_NOERROR, 0, current_directory()); + auto result = VirtualFileSystem::the().open(path.value()->view(), O_RDONLY | O_NOFOLLOW_NOERROR, 0, current_directory()); if (result.is_error()) return result.error(); auto description = result.value(); diff --git a/Kernel/Syscalls/realpath.cpp b/Kernel/Syscalls/realpath.cpp index 13ba7e4f41..5da851da83 100644 --- a/Kernel/Syscalls/realpath.cpp +++ b/Kernel/Syscalls/realpath.cpp @@ -23,7 +23,7 @@ KResultOr Process::sys$realpath(Userspaceview(), current_directory()); + auto custody_or_error = VirtualFileSystem::the().resolve_path(path.value()->view(), current_directory()); if (custody_or_error.is_error()) return custody_or_error.error(); auto& custody = custody_or_error.value(); diff --git a/Kernel/Syscalls/rename.cpp b/Kernel/Syscalls/rename.cpp index 2dcc517f23..7b11781d42 100644 --- a/Kernel/Syscalls/rename.cpp +++ b/Kernel/Syscalls/rename.cpp @@ -22,7 +22,7 @@ KResultOr Process::sys$rename(Userspaceview(), new_path.value()->view(), current_directory()); + return VirtualFileSystem::the().rename(old_path.value()->view(), new_path.value()->view(), current_directory()); } } diff --git a/Kernel/Syscalls/rmdir.cpp b/Kernel/Syscalls/rmdir.cpp index 2a7e9115f1..d6f6306c25 100644 --- a/Kernel/Syscalls/rmdir.cpp +++ b/Kernel/Syscalls/rmdir.cpp @@ -16,7 +16,7 @@ KResultOr Process::sys$rmdir(Userspace user_path, size_t p auto path = get_syscall_path_argument(user_path, path_length); if (path.is_error()) return path.error(); - return VFS::the().rmdir(path.value()->view(), current_directory()); + return VirtualFileSystem::the().rmdir(path.value()->view(), current_directory()); } } diff --git a/Kernel/Syscalls/stat.cpp b/Kernel/Syscalls/stat.cpp index 409b1b92eb..c75716da8b 100644 --- a/Kernel/Syscalls/stat.cpp +++ b/Kernel/Syscalls/stat.cpp @@ -47,7 +47,7 @@ KResultOr Process::sys$stat(Userspace u return EINVAL; base = base_description->custody(); } - auto metadata_or_error = VFS::the().lookup_metadata(path.value()->view(), *base, params.follow_symlinks ? 0 : O_NOFOLLOW_NOERROR); + auto metadata_or_error = VirtualFileSystem::the().lookup_metadata(path.value()->view(), *base, params.follow_symlinks ? 0 : O_NOFOLLOW_NOERROR); if (metadata_or_error.is_error()) return metadata_or_error.error(); stat statbuf; diff --git a/Kernel/Syscalls/statvfs.cpp b/Kernel/Syscalls/statvfs.cpp index 6d34369765..ce7d369d36 100644 --- a/Kernel/Syscalls/statvfs.cpp +++ b/Kernel/Syscalls/statvfs.cpp @@ -13,7 +13,7 @@ namespace Kernel { KResultOr Process::do_statvfs(String path, statvfs* buf) { - auto custody_or_error = VFS::the().resolve_path(path, current_directory(), nullptr, 0); + auto custody_or_error = VirtualFileSystem::the().resolve_path(path, current_directory(), nullptr, 0); if (custody_or_error.is_error()) return custody_or_error.error(); @@ -42,7 +42,7 @@ KResultOr Process::do_statvfs(String path, statvfs* buf) Custody* current_custody = custody; while (current_custody) { - VFS::the().for_each_mount([&kernelbuf, ¤t_custody](auto& mount) { + VirtualFileSystem::the().for_each_mount([&kernelbuf, ¤t_custody](auto& mount) { if (current_custody) { if (¤t_custody->inode() == &mount.guest()) { int mountflags = mount.flags(); diff --git a/Kernel/Syscalls/sync.cpp b/Kernel/Syscalls/sync.cpp index 7b78ba5626..74647e15cb 100644 --- a/Kernel/Syscalls/sync.cpp +++ b/Kernel/Syscalls/sync.cpp @@ -12,7 +12,7 @@ namespace Kernel { KResultOr Process::sys$sync() { REQUIRE_PROMISE(stdio); - VFS::the().sync(); + VirtualFileSystem::the().sync(); return 0; } diff --git a/Kernel/Syscalls/unlink.cpp b/Kernel/Syscalls/unlink.cpp index 1586941126..8f3b8b2cb7 100644 --- a/Kernel/Syscalls/unlink.cpp +++ b/Kernel/Syscalls/unlink.cpp @@ -16,7 +16,7 @@ KResultOr Process::sys$unlink(Userspace user_path, size_t auto path = get_syscall_path_argument(user_path, path_length); if (path.is_error()) return path.error(); - return VFS::the().unlink(path.value()->view(), current_directory()); + return VirtualFileSystem::the().unlink(path.value()->view(), current_directory()); } } diff --git a/Kernel/Syscalls/unveil.cpp b/Kernel/Syscalls/unveil.cpp index ef8fa20fa0..64ca3bad5b 100644 --- a/Kernel/Syscalls/unveil.cpp +++ b/Kernel/Syscalls/unveil.cpp @@ -87,7 +87,7 @@ KResultOr Process::sys$unveil(Userspace parent_custody; // Parent inode in case of ENOENT OwnPtr new_unveiled_path; - auto custody_or_error = VFS::the().resolve_path_without_veil(path.view(), root_directory(), &parent_custody); + auto custody_or_error = VirtualFileSystem::the().resolve_path_without_veil(path.view(), root_directory(), &parent_custody); if (!custody_or_error.is_error()) { new_unveiled_path = custody_or_error.value()->try_create_absolute_path(); if (!new_unveiled_path) diff --git a/Kernel/Syscalls/utime.cpp b/Kernel/Syscalls/utime.cpp index a5f8b9e80d..cec3fd2c9a 100644 --- a/Kernel/Syscalls/utime.cpp +++ b/Kernel/Syscalls/utime.cpp @@ -25,7 +25,7 @@ KResultOr Process::sys$utime(Userspace user_path, size_t p // Not a bug! buf = { now, now }; } - return VFS::the().utime(path.value()->view(), current_directory(), buf.actime, buf.modtime); + return VirtualFileSystem::the().utime(path.value()->view(), current_directory(), buf.actime, buf.modtime); } } diff --git a/Kernel/Tasks/SyncTask.cpp b/Kernel/Tasks/SyncTask.cpp index f660e5c451..2999f73c79 100644 --- a/Kernel/Tasks/SyncTask.cpp +++ b/Kernel/Tasks/SyncTask.cpp @@ -18,7 +18,7 @@ UNMAP_AFTER_INIT void SyncTask::spawn() Process::create_kernel_process(syncd_thread, "SyncTask", [] { dbgln("SyncTask is running"); for (;;) { - VFS::the().sync(); + VirtualFileSystem::the().sync(); (void)Thread::current()->sleep(Time::from_seconds(1)); } }); diff --git a/Kernel/init.cpp b/Kernel/init.cpp index 3ec81f8d3c..3e7b8e8d56 100644 --- a/Kernel/init.cpp +++ b/Kernel/init.cpp @@ -148,7 +148,7 @@ extern "C" [[noreturn]] UNMAP_AFTER_INIT void init() PCI::initialize(); PCISerialDevice::detect(); - VFS::initialize(); + VirtualFileSystem::initialize(); dmesgln("Starting SerenityOS..."); @@ -252,11 +252,11 @@ void init_stage2(void*) SB16::detect(); StorageManagement::initialize(kernel_command_line().root_device(), kernel_command_line().is_force_pio()); - if (!VFS::the().mount_root(StorageManagement::the().root_filesystem())) { - PANIC("VFS::mount_root failed"); + if (!VirtualFileSystem::the().mount_root(StorageManagement::the().root_filesystem())) { + PANIC("VirtualFileSystem::mount_root failed"); } - Process::current()->set_root_directory(VFS::the().root_custody()); + Process::current()->set_root_directory(VirtualFileSystem::the().root_custody()); load_kernel_symbol_table();