diff options
author | Andreas Kling <kling@serenityos.org> | 2023-02-19 23:36:30 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-02-21 00:54:04 +0100 |
commit | 456f12c5c8db085a4eb17498f97e61802852afb3 (patch) | |
tree | 6f5742bde6db4098b097b46c6d55e2b16f4304ef /Userland/Libraries | |
parent | c837e7bbf3b83e11d8cb3044493bb15545f10eff (diff) | |
download | serenity-456f12c5c8db085a4eb17498f97e61802852afb3.zip |
LibPartition: Make Kernel parts const-correct re: StorageDevice&
We can't do I/O with a const StorageDevice&, so it has to be non-const.
Diffstat (limited to 'Userland/Libraries')
8 files changed, 20 insertions, 20 deletions
diff --git a/Userland/Libraries/LibPartition/EBRPartitionTable.cpp b/Userland/Libraries/LibPartition/EBRPartitionTable.cpp index a2c039f796..dcffd39c40 100644 --- a/Userland/Libraries/LibPartition/EBRPartitionTable.cpp +++ b/Userland/Libraries/LibPartition/EBRPartitionTable.cpp @@ -13,7 +13,7 @@ namespace Partition { #ifdef KERNEL -ErrorOr<NonnullOwnPtr<EBRPartitionTable>> EBRPartitionTable::try_to_initialize(Kernel::StorageDevice const& device) +ErrorOr<NonnullOwnPtr<EBRPartitionTable>> EBRPartitionTable::try_to_initialize(Kernel::StorageDevice& device) { auto table = TRY(adopt_nonnull_own_or_enomem(new (nothrow) EBRPartitionTable(device))); #else @@ -29,7 +29,7 @@ ErrorOr<NonnullOwnPtr<EBRPartitionTable>> EBRPartitionTable::try_to_initialize(N } #ifdef KERNEL -void EBRPartitionTable::search_extended_partition(Kernel::StorageDevice const& device, MBRPartitionTable& checked_ebr, u64 current_block_offset, size_t limit) +void EBRPartitionTable::search_extended_partition(Kernel::StorageDevice& device, MBRPartitionTable& checked_ebr, u64 current_block_offset, size_t limit) #else void EBRPartitionTable::search_extended_partition(NonnullRefPtr<Core::DeprecatedFile> device, MBRPartitionTable& checked_ebr, u64 current_block_offset, size_t limit) #endif @@ -53,7 +53,7 @@ void EBRPartitionTable::search_extended_partition(NonnullRefPtr<Core::Deprecated } #ifdef KERNEL -EBRPartitionTable::EBRPartitionTable(Kernel::StorageDevice const& device) +EBRPartitionTable::EBRPartitionTable(Kernel::StorageDevice& device) #else EBRPartitionTable::EBRPartitionTable(NonnullRefPtr<Core::DeprecatedFile> device) #endif diff --git a/Userland/Libraries/LibPartition/EBRPartitionTable.h b/Userland/Libraries/LibPartition/EBRPartitionTable.h index 36598b054a..e88167140c 100644 --- a/Userland/Libraries/LibPartition/EBRPartitionTable.h +++ b/Userland/Libraries/LibPartition/EBRPartitionTable.h @@ -16,8 +16,8 @@ public: ~EBRPartitionTable(); #ifdef KERNEL - static ErrorOr<NonnullOwnPtr<EBRPartitionTable>> try_to_initialize(Kernel::StorageDevice const&); - explicit EBRPartitionTable(Kernel::StorageDevice const&); + static ErrorOr<NonnullOwnPtr<EBRPartitionTable>> try_to_initialize(Kernel::StorageDevice&); + explicit EBRPartitionTable(Kernel::StorageDevice&); #else static ErrorOr<NonnullOwnPtr<EBRPartitionTable>> try_to_initialize(NonnullRefPtr<Core::DeprecatedFile>); explicit EBRPartitionTable(NonnullRefPtr<Core::DeprecatedFile>); @@ -30,7 +30,7 @@ public: private: #ifdef KERNEL - void search_extended_partition(Kernel::StorageDevice const&, MBRPartitionTable&, u64, size_t limit); + void search_extended_partition(Kernel::StorageDevice&, MBRPartitionTable&, u64, size_t limit); #else void search_extended_partition(NonnullRefPtr<Core::DeprecatedFile>, MBRPartitionTable&, u64, size_t limit); #endif diff --git a/Userland/Libraries/LibPartition/GUIDPartitionTable.cpp b/Userland/Libraries/LibPartition/GUIDPartitionTable.cpp index 284771b7a2..1444cd2af2 100644 --- a/Userland/Libraries/LibPartition/GUIDPartitionTable.cpp +++ b/Userland/Libraries/LibPartition/GUIDPartitionTable.cpp @@ -49,7 +49,7 @@ struct [[gnu::packed]] GUIDPartitionHeader { }; #ifdef KERNEL -ErrorOr<NonnullOwnPtr<GUIDPartitionTable>> GUIDPartitionTable::try_to_initialize(Kernel::StorageDevice const& device) +ErrorOr<NonnullOwnPtr<GUIDPartitionTable>> GUIDPartitionTable::try_to_initialize(Kernel::StorageDevice& device) { auto table = TRY(adopt_nonnull_own_or_enomem(new (nothrow) GUIDPartitionTable(device))); #else @@ -63,7 +63,7 @@ ErrorOr<NonnullOwnPtr<GUIDPartitionTable>> GUIDPartitionTable::try_to_initialize } #ifdef KERNEL -GUIDPartitionTable::GUIDPartitionTable(Kernel::StorageDevice const& device) +GUIDPartitionTable::GUIDPartitionTable(Kernel::StorageDevice& device) : MBRPartitionTable(device) #else GUIDPartitionTable::GUIDPartitionTable(NonnullRefPtr<Core::DeprecatedFile> device_file) diff --git a/Userland/Libraries/LibPartition/GUIDPartitionTable.h b/Userland/Libraries/LibPartition/GUIDPartitionTable.h index f8e21dcd01..55d384cda3 100644 --- a/Userland/Libraries/LibPartition/GUIDPartitionTable.h +++ b/Userland/Libraries/LibPartition/GUIDPartitionTable.h @@ -16,8 +16,8 @@ public: virtual ~GUIDPartitionTable() = default; #ifdef KERNEL - static ErrorOr<NonnullOwnPtr<GUIDPartitionTable>> try_to_initialize(Kernel::StorageDevice const&); - explicit GUIDPartitionTable(Kernel::StorageDevice const&); + static ErrorOr<NonnullOwnPtr<GUIDPartitionTable>> try_to_initialize(Kernel::StorageDevice&); + explicit GUIDPartitionTable(Kernel::StorageDevice&); #else static ErrorOr<NonnullOwnPtr<GUIDPartitionTable>> try_to_initialize(NonnullRefPtr<Core::DeprecatedFile>); explicit GUIDPartitionTable(NonnullRefPtr<Core::DeprecatedFile>); diff --git a/Userland/Libraries/LibPartition/MBRPartitionTable.cpp b/Userland/Libraries/LibPartition/MBRPartitionTable.cpp index 2064df17a3..3b46dcc654 100644 --- a/Userland/Libraries/LibPartition/MBRPartitionTable.cpp +++ b/Userland/Libraries/LibPartition/MBRPartitionTable.cpp @@ -19,7 +19,7 @@ namespace Partition { #define EBR_LBA_CONTAINER 0x0F #ifdef KERNEL -ErrorOr<NonnullOwnPtr<MBRPartitionTable>> MBRPartitionTable::try_to_initialize(Kernel::StorageDevice const& device) +ErrorOr<NonnullOwnPtr<MBRPartitionTable>> MBRPartitionTable::try_to_initialize(Kernel::StorageDevice& device) { auto table = TRY(adopt_nonnull_own_or_enomem(new (nothrow) MBRPartitionTable(device))); #else @@ -37,7 +37,7 @@ ErrorOr<NonnullOwnPtr<MBRPartitionTable>> MBRPartitionTable::try_to_initialize(N } #ifdef KERNEL -OwnPtr<MBRPartitionTable> MBRPartitionTable::try_to_initialize(Kernel::StorageDevice const& device, u32 start_lba) +OwnPtr<MBRPartitionTable> MBRPartitionTable::try_to_initialize(Kernel::StorageDevice& device, u32 start_lba) { auto table = adopt_nonnull_own_or_enomem(new (nothrow) MBRPartitionTable(device, start_lba)).release_value_but_fixme_should_propagate_errors(); #else @@ -66,7 +66,7 @@ bool MBRPartitionTable::read_boot_record() } #ifdef KERNEL -MBRPartitionTable::MBRPartitionTable(Kernel::StorageDevice const& device, u32 start_lba) +MBRPartitionTable::MBRPartitionTable(Kernel::StorageDevice& device, u32 start_lba) : PartitionTable(device) #else MBRPartitionTable::MBRPartitionTable(NonnullRefPtr<Core::DeprecatedFile> device_file, u32 start_lba) @@ -92,7 +92,7 @@ MBRPartitionTable::MBRPartitionTable(NonnullRefPtr<Core::DeprecatedFile> device_ } #ifdef KERNEL -MBRPartitionTable::MBRPartitionTable(Kernel::StorageDevice const& device) +MBRPartitionTable::MBRPartitionTable(Kernel::StorageDevice& device) : PartitionTable(device) #else MBRPartitionTable::MBRPartitionTable(NonnullRefPtr<Core::DeprecatedFile> device_file) diff --git a/Userland/Libraries/LibPartition/MBRPartitionTable.h b/Userland/Libraries/LibPartition/MBRPartitionTable.h index 48bc24a6dd..269c23d342 100644 --- a/Userland/Libraries/LibPartition/MBRPartitionTable.h +++ b/Userland/Libraries/LibPartition/MBRPartitionTable.h @@ -39,10 +39,10 @@ public: ~MBRPartitionTable(); #ifdef KERNEL - static ErrorOr<NonnullOwnPtr<MBRPartitionTable>> try_to_initialize(Kernel::StorageDevice const&); - static OwnPtr<MBRPartitionTable> try_to_initialize(Kernel::StorageDevice const&, u32 start_lba); - explicit MBRPartitionTable(Kernel::StorageDevice const&); - MBRPartitionTable(Kernel::StorageDevice const&, u32 start_lba); + static ErrorOr<NonnullOwnPtr<MBRPartitionTable>> try_to_initialize(Kernel::StorageDevice&); + static OwnPtr<MBRPartitionTable> try_to_initialize(Kernel::StorageDevice&, u32 start_lba); + explicit MBRPartitionTable(Kernel::StorageDevice&); + MBRPartitionTable(Kernel::StorageDevice&, u32 start_lba); #else static ErrorOr<NonnullOwnPtr<MBRPartitionTable>> try_to_initialize(NonnullRefPtr<Core::DeprecatedFile>); static OwnPtr<MBRPartitionTable> try_to_initialize(NonnullRefPtr<Core::DeprecatedFile>, u32 start_lba); diff --git a/Userland/Libraries/LibPartition/PartitionTable.cpp b/Userland/Libraries/LibPartition/PartitionTable.cpp index 19940da367..0be1ece644 100644 --- a/Userland/Libraries/LibPartition/PartitionTable.cpp +++ b/Userland/Libraries/LibPartition/PartitionTable.cpp @@ -14,7 +14,7 @@ namespace Partition { #ifdef KERNEL -PartitionTable::PartitionTable(Kernel::StorageDevice const& device) +PartitionTable::PartitionTable(Kernel::StorageDevice& device) : m_device(device) , m_block_size(device.block_size()) { diff --git a/Userland/Libraries/LibPartition/PartitionTable.h b/Userland/Libraries/LibPartition/PartitionTable.h index d1026c5f71..cfe828491e 100644 --- a/Userland/Libraries/LibPartition/PartitionTable.h +++ b/Userland/Libraries/LibPartition/PartitionTable.h @@ -29,7 +29,7 @@ public: protected: #ifdef KERNEL - explicit PartitionTable(Kernel::StorageDevice const&); + explicit PartitionTable(Kernel::StorageDevice&); NonnullRefPtr<Kernel::StorageDevice> m_device; #else explicit PartitionTable(NonnullRefPtr<Core::DeprecatedFile>); |