summaryrefslogtreecommitdiff
path: root/Kernel/Storage/StorageManagement.cpp
diff options
context:
space:
mode:
authorLiav A <liavalb@gmail.com>2021-02-25 19:36:49 +0200
committerAndreas Kling <kling@serenityos.org>2021-03-05 11:29:34 +0100
commitb59e45e65cf2c90196a991891dd1ae6caa950f3b (patch)
tree71df80b08997cfc959831d359dc74603306172a6 /Kernel/Storage/StorageManagement.cpp
parent566c10b8b82ed5266659af8661abf59787afb3c1 (diff)
downloadserenity-b59e45e65cf2c90196a991891dd1ae6caa950f3b.zip
Kernel: Use global mechanism to determine minor number of Storage Device
Diffstat (limited to 'Kernel/Storage/StorageManagement.cpp')
-rw-r--r--Kernel/Storage/StorageManagement.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/Kernel/Storage/StorageManagement.cpp b/Kernel/Storage/StorageManagement.cpp
index fdbee54975..297a0dd6ad 100644
--- a/Kernel/Storage/StorageManagement.cpp
+++ b/Kernel/Storage/StorageManagement.cpp
@@ -40,6 +40,7 @@
namespace Kernel {
static StorageManagement* s_the;
+static size_t s_device_minor_number;
UNMAP_AFTER_INIT StorageManagement::StorageManagement(String boot_argument, bool force_pio)
: m_boot_argument(boot_argument)
@@ -47,6 +48,7 @@ UNMAP_AFTER_INIT StorageManagement::StorageManagement(String boot_argument, bool
, m_storage_devices(enumerate_storage_devices())
, m_disk_partitions(enumerate_disk_partitions())
{
+ s_device_minor_number = 0;
if (!boot_argument_contains_partition_uuid()) {
determine_boot_device();
return;
@@ -177,6 +179,15 @@ RefPtr<BlockDevice> StorageManagement::boot_block_device() const
return m_boot_block_device;
}
+int StorageManagement::major_number()
+{
+ return 3;
+}
+int StorageManagement::minor_number()
+{
+ return s_device_minor_number++;
+}
+
NonnullRefPtr<FS> StorageManagement::root_filesystem() const
{
auto boot_device_description = boot_block_device();