summaryrefslogtreecommitdiff
path: root/Kernel/Storage/Partition
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-02-23 20:42:32 +0100
committerAndreas Kling <kling@serenityos.org>2021-02-23 20:56:54 +0100
commit5d180d1f996ead27f9c5cb3db7f91e293de34d9d (patch)
treee881854dac5d749518562970d6194a0ef65736ec /Kernel/Storage/Partition
parentb33a6a443e700cd80325d312f21c985b0687bb97 (diff)
downloadserenity-5d180d1f996ead27f9c5cb3db7f91e293de34d9d.zip
Everywhere: Rename ASSERT => VERIFY
(...and ASSERT_NOT_REACHED => VERIFY_NOT_REACHED) Since all of these checks are done in release builds as well, let's rename them to VERIFY to prevent confusion, as everyone is used to assertions being compiled out in release. We can introduce a new ASSERT macro that is specifically for debug checks, but I'm doing this wholesale conversion first since we've accumulated thousands of these already, and it's not immediately obvious which ones are suitable for ASSERT.
Diffstat (limited to 'Kernel/Storage/Partition')
-rw-r--r--Kernel/Storage/Partition/DiskPartitionMetadata.cpp12
-rw-r--r--Kernel/Storage/Partition/EBRPartitionTable.cpp6
-rw-r--r--Kernel/Storage/Partition/GUIDPartitionTable.cpp4
3 files changed, 11 insertions, 11 deletions
diff --git a/Kernel/Storage/Partition/DiskPartitionMetadata.cpp b/Kernel/Storage/Partition/DiskPartitionMetadata.cpp
index aa2dbd6fb0..1da3d59ae1 100644
--- a/Kernel/Storage/Partition/DiskPartitionMetadata.cpp
+++ b/Kernel/Storage/Partition/DiskPartitionMetadata.cpp
@@ -40,12 +40,12 @@ DiskPartitionMetadata::PartitionType::PartitionType(Array<u8, 16> partition_type
}
UUID DiskPartitionMetadata::PartitionType::to_uuid() const
{
- ASSERT(is_uuid());
+ VERIFY(is_uuid());
return m_partition_type;
}
u8 DiskPartitionMetadata::PartitionType::to_byte_indicator() const
{
- ASSERT(!is_uuid());
+ VERIFY(!is_uuid());
return m_partition_type[0];
}
bool DiskPartitionMetadata::PartitionType::is_uuid() const
@@ -63,7 +63,7 @@ DiskPartitionMetadata::DiskPartitionMetadata(u64 start_block, u64 end_block, u8
, m_type(partition_type)
{
- ASSERT(m_type.is_valid());
+ VERIFY(m_type.is_valid());
}
DiskPartitionMetadata::DiskPartitionMetadata(u64 start_block, u64 end_block, Array<u8, 16> partition_type)
@@ -72,7 +72,7 @@ DiskPartitionMetadata::DiskPartitionMetadata(u64 start_block, u64 end_block, Arr
, m_type(partition_type)
{
- ASSERT(m_type.is_valid());
+ VERIFY(m_type.is_valid());
}
DiskPartitionMetadata::DiskPartitionMetadata(u64 start_block, u64 end_block, Array<u8, 16> partition_type, UUID unique_guid, u64 special_attributes, String name)
@@ -83,8 +83,8 @@ DiskPartitionMetadata::DiskPartitionMetadata(u64 start_block, u64 end_block, Arr
, m_attributes(special_attributes)
, m_name(name)
{
- ASSERT(m_type.is_valid());
- ASSERT(!m_unique_guid.is_zero());
+ VERIFY(m_type.is_valid());
+ VERIFY(!m_unique_guid.is_zero());
}
DiskPartitionMetadata DiskPartitionMetadata::offset(u64 blocks_count) const
diff --git a/Kernel/Storage/Partition/EBRPartitionTable.cpp b/Kernel/Storage/Partition/EBRPartitionTable.cpp
index a61e305c8d..d67f210600 100644
--- a/Kernel/Storage/Partition/EBRPartitionTable.cpp
+++ b/Kernel/Storage/Partition/EBRPartitionTable.cpp
@@ -44,11 +44,11 @@ void EBRPartitionTable::search_extended_partition(const StorageDevice& device, M
if (limit == 0)
return;
// EBRs should not carry more than 2 partitions (because they need to form a linked list)
- ASSERT(checked_ebr.partitions_count() <= 2);
+ VERIFY(checked_ebr.partitions_count() <= 2);
auto checked_logical_partition = checked_ebr.partition(0);
// If we are pointed to an invalid logical partition, something is seriously wrong.
- ASSERT(checked_logical_partition.has_value());
+ VERIFY(checked_logical_partition.has_value());
m_partitions.append(checked_logical_partition.value().offset(current_block_offset));
if (!checked_ebr.contains_ebr())
return;
@@ -66,7 +66,7 @@ EBRPartitionTable::EBRPartitionTable(const StorageDevice& device)
return;
m_valid = true;
- ASSERT(partitions_count() == 0);
+ VERIFY(partitions_count() == 0);
auto& header = this->header();
for (size_t index = 0; index < 4; index++) {
diff --git a/Kernel/Storage/Partition/GUIDPartitionTable.cpp b/Kernel/Storage/Partition/GUIDPartitionTable.cpp
index 9f7b787aa5..d4e1c2639e 100644
--- a/Kernel/Storage/Partition/GUIDPartitionTable.cpp
+++ b/Kernel/Storage/Partition/GUIDPartitionTable.cpp
@@ -79,7 +79,7 @@ GUIDPartitionTable::GUIDPartitionTable(const StorageDevice& device)
: MBRPartitionTable(device)
{
m_cached_header = ByteBuffer::create_zeroed(m_device->block_size());
- ASSERT(partitions_count() == 0);
+ VERIFY(partitions_count() == 0);
if (!initialize())
m_valid = false;
}
@@ -91,7 +91,7 @@ const GUIDPartitionHeader& GUIDPartitionTable::header() const
bool GUIDPartitionTable::initialize()
{
- ASSERT(m_cached_header.data() != nullptr);
+ VERIFY(m_cached_header.data() != nullptr);
auto first_gpt_block = (m_device->block_size() == 512) ? 1 : 0;