mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-12 22:22:55 +00:00
Kernel: Change Ext2FS to be backed by a file instead of a block device
In contrast to the previous patchset that was reverted, this time we use a "special" method to access a file with block size of 512 bytes (like a harddrive essentially).
This commit is contained in:
parent
1d6c8724b9
commit
ecee76b741
Notes:
sideshowbarker
2024-07-19 07:51:19 +09:00
Author: https://github.com/supercomputer7
Commit: ecee76b741
Pull-request: https://github.com/SerenityOS/serenity/pull/1663
Reviewed-by: https://github.com/awesomekling
10 changed files with 104 additions and 77 deletions
Kernel/FileSystem
|
@ -28,7 +28,7 @@
|
|||
#include <AK/StringBuilder.h>
|
||||
#include <Kernel/Devices/BlockDevice.h>
|
||||
#include <Kernel/FileSystem/Custody.h>
|
||||
#include <Kernel/FileSystem/DiskBackedFileSystem.h>
|
||||
#include <Kernel/FileSystem/FileBackedFileSystem.h>
|
||||
#include <Kernel/FileSystem/FileDescription.h>
|
||||
#include <Kernel/FileSystem/FileSystem.h>
|
||||
#include <Kernel/FileSystem/VirtualFileSystem.h>
|
||||
|
@ -126,14 +126,7 @@ bool VFS::mount_root(FS& file_system)
|
|||
}
|
||||
|
||||
m_root_inode = move(root_inode);
|
||||
char device_name[32];
|
||||
if (m_root_inode->fs().is_disk_backed()) {
|
||||
auto& device = static_cast<DiskBackedFS&>(m_root_inode->fs()).device();
|
||||
sprintf(device_name, "%d,%d", device.major(), device.minor());
|
||||
} else {
|
||||
sprintf(device_name, "not-a-disk");
|
||||
}
|
||||
klog() << "VFS: mounted root on " << m_root_inode->fs().class_name() << " (" << device_name << ")";
|
||||
klog() << "VFS: mounted root from " << m_root_inode->fs().class_name() << " (" << static_cast<FileBackedFS&>(m_root_inode->fs()).file_description().absolute_path() << ")";
|
||||
|
||||
m_mounts.append(move(mount));
|
||||
return true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue