Kernel: Make major and minor numbers to be DistinctNumerics

This helps avoid confusion in general, and make constructors, methods
and code patterns much more clean and understandable.
This commit is contained in:
Liav A 2021-12-23 20:08:18 +02:00 committed by Andreas Kling
commit 9eb08bdb0f
Notes: sideshowbarker 2024-07-17 22:19:42 +09:00
24 changed files with 70 additions and 52 deletions

View file

@ -24,7 +24,7 @@
namespace Kernel {
static Singleton<StorageManagement> s_the;
static Atomic<size_t> s_device_minor_number;
static Atomic<u32> s_device_minor_number;
static constexpr StringView partition_uuid_prefix = "PARTUUID="sv;
@ -179,11 +179,11 @@ RefPtr<BlockDevice> StorageManagement::boot_block_device() const
return m_boot_block_device.strong_ref();
}
int StorageManagement::major_number()
MajorNumber StorageManagement::storage_type_major_number()
{
return 3;
}
int StorageManagement::minor_number()
MinorNumber StorageManagement::generate_storage_minor_number()
{
auto minor_number = s_device_minor_number.load();
s_device_minor_number++;