mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-29 12:49:08 +00:00
Kernel: Use DistinctNumeric for filesystem ID's
This patch adds the FileSystemID type, which is a distinct u32. This prevents accidental conversion from arbitrary integers.
This commit is contained in:
@@ -16,9 +16,9 @@
|
||||
namespace Kernel {
|
||||
|
||||
static u32 s_lastFileSystemID;
|
||||
static Singleton<HashMap<u32, FileSystem*>> s_file_system_map;
|
||||
static Singleton<HashMap<FileSystemID, FileSystem*>> s_file_system_map;
|
||||
|
||||
static HashMap<u32, FileSystem*>& all_file_systems()
|
||||
static HashMap<FileSystemID, FileSystem*>& all_file_systems()
|
||||
{
|
||||
return *s_file_system_map;
|
||||
}
|
||||
@@ -34,7 +34,7 @@ FileSystem::~FileSystem()
|
||||
s_file_system_map->remove(m_fsid);
|
||||
}
|
||||
|
||||
FileSystem* FileSystem::from_fsid(u32 id)
|
||||
FileSystem* FileSystem::from_fsid(FileSystemID id)
|
||||
{
|
||||
auto it = all_file_systems().find(id);
|
||||
if (it != all_file_systems().end())
|
||||
|
||||
Reference in New Issue
Block a user