mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 05:38:11 +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:
parent
7c57961c61
commit
e08d213830
18 changed files with 36 additions and 35 deletions
|
@ -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())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue