From 394168c0ca431fd81f886d120ff57599845877fb Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Wed, 24 Jul 2019 09:15:33 +0200 Subject: [PATCH] Kernel: Convert Vector to NonnullOwnPtrVector. --- Kernel/FileSystem/VirtualFileSystem.cpp | 10 +++++----- Kernel/FileSystem/VirtualFileSystem.h | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Kernel/FileSystem/VirtualFileSystem.cpp b/Kernel/FileSystem/VirtualFileSystem.cpp index b4b0c3513c1..0070eff053c 100644 --- a/Kernel/FileSystem/VirtualFileSystem.cpp +++ b/Kernel/FileSystem/VirtualFileSystem.cpp @@ -82,8 +82,8 @@ bool VFS::mount_root(NonnullRefPtr&& file_system) auto VFS::find_mount_for_host(InodeIdentifier inode) -> Mount* { for (auto& mount : m_mounts) { - if (mount->host() == inode) - return mount.ptr(); + if (mount.host() == inode) + return &mount; } return nullptr; } @@ -91,8 +91,8 @@ auto VFS::find_mount_for_host(InodeIdentifier inode) -> Mount* auto VFS::find_mount_for_guest(InodeIdentifier inode) -> Mount* { for (auto& mount : m_mounts) { - if (mount->guest() == inode) - return mount.ptr(); + if (mount.guest() == inode) + return &mount; } return nullptr; } @@ -608,7 +608,7 @@ Device* VFS::get_device(unsigned major, unsigned minor) void VFS::for_each_mount(Function callback) const { for (auto& mount : m_mounts) { - callback(*mount); + callback(mount); } } diff --git a/Kernel/FileSystem/VirtualFileSystem.h b/Kernel/FileSystem/VirtualFileSystem.h index 230dadb7ad6..fa2c3e5550e 100644 --- a/Kernel/FileSystem/VirtualFileSystem.h +++ b/Kernel/FileSystem/VirtualFileSystem.h @@ -4,9 +4,9 @@ #include #include #include +#include #include #include -#include #include #include #include @@ -106,7 +106,7 @@ private: Mount* find_mount_for_guest(InodeIdentifier); RefPtr m_root_inode; - Vector> m_mounts; + NonnullOwnPtrVector m_mounts; HashMap m_devices; RefPtr m_root_custody;