mirror of
https://github.com/RGBCube/serenity
synced 2025-05-23 19:15:07 +00:00
Kernel/VFS: Remove the find_mount_for_guest method
We don't really need this method anymore, because we could just try to find the mount entry based on the given mount point host custody. This also allows us to remove the is_vfs_root and root_inode_id methods from the VirtualFileSystem class.
This commit is contained in:
parent
e5c7662638
commit
d216f780a4
2 changed files with 2 additions and 29 deletions
|
@ -94,12 +94,6 @@ UNMAP_AFTER_INIT VirtualFileSystem::VirtualFileSystem()
|
|||
|
||||
UNMAP_AFTER_INIT VirtualFileSystem::~VirtualFileSystem() = default;
|
||||
|
||||
InodeIdentifier VirtualFileSystem::root_inode_id() const
|
||||
{
|
||||
VERIFY(m_root_inode);
|
||||
return m_root_inode->identifier();
|
||||
}
|
||||
|
||||
bool VirtualFileSystem::check_matching_absolute_path_hierarchy(Custody const& first_custody, Custody const& second_custody)
|
||||
{
|
||||
// Are both custodies the root mount?
|
||||
|
@ -251,7 +245,7 @@ ErrorOr<void> VirtualFileSystem::remount(Custody& mount_point, int new_flags)
|
|||
{
|
||||
dbgln("VirtualFileSystem: Remounting inode {}", mount_point.inode().identifier());
|
||||
|
||||
auto* mount = find_mount_for_guest(mount_point.inode().identifier());
|
||||
auto* mount = find_mount_for_host_custody(mount_point);
|
||||
if (!mount)
|
||||
return ENODEV;
|
||||
|
||||
|
@ -400,22 +394,6 @@ auto VirtualFileSystem::find_mount_for_host_custody(Custody const& current_custo
|
|||
});
|
||||
}
|
||||
|
||||
auto VirtualFileSystem::find_mount_for_guest(InodeIdentifier id) -> Mount*
|
||||
{
|
||||
return m_mounts.with([&](auto& mounts) -> Mount* {
|
||||
for (auto& mount : mounts) {
|
||||
if (mount.guest().identifier() == id)
|
||||
return &mount;
|
||||
}
|
||||
return nullptr;
|
||||
});
|
||||
}
|
||||
|
||||
bool VirtualFileSystem::is_vfs_root(InodeIdentifier inode) const
|
||||
{
|
||||
return inode == root_inode_id();
|
||||
}
|
||||
|
||||
ErrorOr<void> VirtualFileSystem::traverse_directory_inode(Inode& dir_inode, Function<ErrorOr<void>(FileSystem::DirectoryEntryView const&)> callback)
|
||||
{
|
||||
return dir_inode.traverse_as_directory([&](auto& entry) -> ErrorOr<void> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue