summaryrefslogtreecommitdiff
path: root/Kernel/Storage
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-03-12 14:02:17 +0100
committerAndreas Kling <kling@serenityos.org>2021-03-12 15:22:35 +0100
commit8a7fe86ee00d5526de12b008eb6679793aaec459 (patch)
treeb6706deaed8d4a3e6a683ef91be5aef8be049344 /Kernel/Storage
parentfeda905c3f13643adc352b3eef8bd3503bab69c4 (diff)
downloadserenity-8a7fe86ee00d5526de12b008eb6679793aaec459.zip
Kernel: Convert klog() => AK::Format in Storage
Diffstat (limited to 'Kernel/Storage')
-rw-r--r--Kernel/Storage/Partition/GUIDPartitionTable.cpp6
-rw-r--r--Kernel/Storage/Partition/MBRPartitionTable.cpp8
-rw-r--r--Kernel/Storage/RamdiskDevice.cpp2
-rw-r--r--Kernel/Storage/StorageDevice.cpp8
4 files changed, 7 insertions, 17 deletions
diff --git a/Kernel/Storage/Partition/GUIDPartitionTable.cpp b/Kernel/Storage/Partition/GUIDPartitionTable.cpp
index d4e1c2639e..a6272d0d16 100644
--- a/Kernel/Storage/Partition/GUIDPartitionTable.cpp
+++ b/Kernel/Storage/Partition/GUIDPartitionTable.cpp
@@ -100,12 +100,10 @@ bool GUIDPartitionTable::initialize()
return false;
}
-#if GPT_DEBUG
- klog() << "GUIDPartitionTable: signature - 0x" << String::format("%x", header().sig[1]) << String::format("%x", header().sig[0]);
-#endif
+ dbgln_if(GPT_DEBUG, "GUIDPartitionTable: signature - {:#08x} {:#08x}", header().sig[1], header().sig[0]);
if (header().sig[0] != GPT_SIGNATURE && header().sig[1] != GPT_SIGNATURE2) {
- klog() << "GUIDPartitionTable: bad signature 0x" << String::format("%x", header().sig[1]) << String::format("%x", header().sig[0]);
+ dbgln("GUIDPartitionTable: bad signature {:#08x} {:#08x}", header().sig[1], header().sig[0]);
return false;
}
diff --git a/Kernel/Storage/Partition/MBRPartitionTable.cpp b/Kernel/Storage/Partition/MBRPartitionTable.cpp
index e56cc9ed2e..4fc6efe3a7 100644
--- a/Kernel/Storage/Partition/MBRPartitionTable.cpp
+++ b/Kernel/Storage/Partition/MBRPartitionTable.cpp
@@ -120,13 +120,9 @@ const MBRPartitionTable::Header& MBRPartitionTable::header() const
bool MBRPartitionTable::initialize()
{
auto& header = this->header();
-#if MBR_DEBUG
-
- klog() << "Master Boot Record: mbr_signature=0x" << String::format("%x", header.mbr_signature);
-
-#endif
+ dbgln_if(MBR_DEBUG, "Master Boot Record: mbr_signature={:#08x}", header.mbr_signature);
if (header.mbr_signature != MBR_SIGNATURE) {
- klog() << "Master Boot Record: invalid signature";
+ dbgln("Master Boot Record: invalid signature");
return false;
}
return true;
diff --git a/Kernel/Storage/RamdiskDevice.cpp b/Kernel/Storage/RamdiskDevice.cpp
index c73e47b431..e6b8953337 100644
--- a/Kernel/Storage/RamdiskDevice.cpp
+++ b/Kernel/Storage/RamdiskDevice.cpp
@@ -41,7 +41,7 @@ RamdiskDevice::RamdiskDevice(const RamdiskController& controller, OwnPtr<Region>
: StorageDevice(controller, major, minor, 512, 0)
, m_region(move(region))
{
- klog() << "Ramdisk: Device #" << minor << " @ " << m_region->vaddr() << " length " << m_region->size();
+ dmesgln("Ramdisk: Device #{} @ {}, length {}", minor, m_region->vaddr(), m_region->size());
}
RamdiskDevice::~RamdiskDevice()
diff --git a/Kernel/Storage/StorageDevice.cpp b/Kernel/Storage/StorageDevice.cpp
index 63ac18ada0..0763813f9c 100644
--- a/Kernel/Storage/StorageDevice.cpp
+++ b/Kernel/Storage/StorageDevice.cpp
@@ -72,9 +72,7 @@ KResultOr<size_t> StorageDevice::read(FileDescription&, size_t offset, UserOrKer
remaining = 0;
}
-#if STORAGE_DEVICE_DEBUG
- klog() << "StorageDevice::read() index=" << index << " whole_blocks=" << whole_blocks << " remaining=" << remaining;
-#endif
+ dbgln_if(STORAGE_DEVICE_DEBUG, "StorageDevice::read() index={}, whole_blocks={}, remaining={}", index, whole_blocks, remaining);
if (whole_blocks > 0) {
auto read_request = make_request<AsyncBlockDeviceRequest>(AsyncBlockDeviceRequest::Read, index, whole_blocks, outbuf, whole_blocks * block_size());
@@ -139,9 +137,7 @@ KResultOr<size_t> StorageDevice::write(FileDescription&, size_t offset, const Us
remaining = 0;
}
-#if STORAGE_DEVICE_DEBUG
- klog() << "StorageDevice::write() index=" << index << " whole_blocks=" << whole_blocks << " remaining=" << remaining;
-#endif
+ dbgln_if(STORAGE_DEVICE_DEBUG, "StorageDevice::write() index={}, whole_blocks={}, remaining={}", index, whole_blocks, remaining);
if (whole_blocks > 0) {
auto write_request = make_request<AsyncBlockDeviceRequest>(AsyncBlockDeviceRequest::Write, index, whole_blocks, inbuf, whole_blocks * block_size());