diff options
author | Andreas Kling <kling@serenityos.org> | 2021-11-18 15:11:31 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-11-18 21:11:30 +0100 |
commit | e08d213830f8459f0d0d20d56668d479479a444d (patch) | |
tree | b2380d13c7c7343d0c33fdc667e8ec3dfec5c41d /Kernel/FileSystem/FileSystem.cpp | |
parent | 7c57961c61aada999bf1dbc871708546b4fe1ba9 (diff) | |
download | serenity-e08d213830f8459f0d0d20d56668d479479a444d.zip |
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.
Diffstat (limited to 'Kernel/FileSystem/FileSystem.cpp')
-rw-r--r-- | Kernel/FileSystem/FileSystem.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Kernel/FileSystem/FileSystem.cpp b/Kernel/FileSystem/FileSystem.cpp index 10eb4f50f4..368d924425 100644 --- a/Kernel/FileSystem/FileSystem.cpp +++ b/Kernel/FileSystem/FileSystem.cpp @@ -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()) |