1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 07:38:10 +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:
Andreas Kling 2021-11-18 15:11:31 +01:00
parent 7c57961c61
commit e08d213830
18 changed files with 36 additions and 35 deletions

View file

@ -46,7 +46,7 @@ NonnullRefPtr<SysFSRootDirectory> SysFSRootDirectory::create()
return adopt_ref(*new (nothrow) SysFSRootDirectory);
}
ErrorOr<void> SysFSRootDirectory::traverse_as_directory(unsigned fsid, Function<ErrorOr<void>(FileSystem::DirectoryEntryView const&)> callback) const
ErrorOr<void> SysFSRootDirectory::traverse_as_directory(FileSystemID fsid, Function<ErrorOr<void>(FileSystem::DirectoryEntryView const&)> callback) const
{
MutexLocker locker(SysFSComponentRegistry::the().get_lock());
TRY(callback({ ".", { fsid, component_index() }, 0 }));