From 0cdd227e9b526a3e89c316d36689eb1ac7c09417 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 19 Feb 2023 23:16:05 +0100 Subject: [PATCH] Kernel: Fix const-correctness issue in StorageManagement We have to take the StorageDevice as a mutable reference, otherwise we can't perform any interesting I/O operations on it. --- Kernel/Storage/StorageManagement.cpp | 2 +- Kernel/Storage/StorageManagement.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel/Storage/StorageManagement.cpp b/Kernel/Storage/StorageManagement.cpp index 1689703ef6..62ec69ed62 100644 --- a/Kernel/Storage/StorageManagement.cpp +++ b/Kernel/Storage/StorageManagement.cpp @@ -156,7 +156,7 @@ UNMAP_AFTER_INIT void StorageManagement::dump_storage_devices_and_partitions() c } } -UNMAP_AFTER_INIT ErrorOr> StorageManagement::try_to_initialize_partition_table(StorageDevice const& device) const +UNMAP_AFTER_INIT ErrorOr> StorageManagement::try_to_initialize_partition_table(StorageDevice& device) const { auto mbr_table_or_error = Partition::MBRPartitionTable::try_to_initialize(device); if (!mbr_table_or_error.is_error()) diff --git a/Kernel/Storage/StorageManagement.h b/Kernel/Storage/StorageManagement.h index 46a8b743a4..f8512ba13f 100644 --- a/Kernel/Storage/StorageManagement.h +++ b/Kernel/Storage/StorageManagement.h @@ -61,7 +61,7 @@ private: void dump_storage_devices_and_partitions() const; - ErrorOr> try_to_initialize_partition_table(StorageDevice const&) const; + ErrorOr> try_to_initialize_partition_table(StorageDevice&) const; LockRefPtr boot_block_device() const;