1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:38:11 +00:00

Kernel: Convert klog() => AK::Format in Storage

This commit is contained in:
Andreas Kling 2021-03-12 14:02:17 +01:00
parent feda905c3f
commit 8a7fe86ee0
4 changed files with 7 additions and 17 deletions

View file

@ -100,12 +100,10 @@ bool GUIDPartitionTable::initialize()
return false; return false;
} }
#if GPT_DEBUG dbgln_if(GPT_DEBUG, "GUIDPartitionTable: signature - {:#08x} {:#08x}", header().sig[1], header().sig[0]);
klog() << "GUIDPartitionTable: signature - 0x" << String::format("%x", header().sig[1]) << String::format("%x", header().sig[0]);
#endif
if (header().sig[0] != GPT_SIGNATURE && header().sig[1] != GPT_SIGNATURE2) { 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; return false;
} }

View file

@ -120,13 +120,9 @@ const MBRPartitionTable::Header& MBRPartitionTable::header() const
bool MBRPartitionTable::initialize() bool MBRPartitionTable::initialize()
{ {
auto& header = this->header(); auto& header = this->header();
#if MBR_DEBUG dbgln_if(MBR_DEBUG, "Master Boot Record: mbr_signature={:#08x}", header.mbr_signature);
klog() << "Master Boot Record: mbr_signature=0x" << String::format("%x", header.mbr_signature);
#endif
if (header.mbr_signature != MBR_SIGNATURE) { if (header.mbr_signature != MBR_SIGNATURE) {
klog() << "Master Boot Record: invalid signature"; dbgln("Master Boot Record: invalid signature");
return false; return false;
} }
return true; return true;

View file

@ -41,7 +41,7 @@ RamdiskDevice::RamdiskDevice(const RamdiskController& controller, OwnPtr<Region>
: StorageDevice(controller, major, minor, 512, 0) : StorageDevice(controller, major, minor, 512, 0)
, m_region(move(region)) , 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() RamdiskDevice::~RamdiskDevice()

View file

@ -72,9 +72,7 @@ KResultOr<size_t> StorageDevice::read(FileDescription&, size_t offset, UserOrKer
remaining = 0; remaining = 0;
} }
#if STORAGE_DEVICE_DEBUG dbgln_if(STORAGE_DEVICE_DEBUG, "StorageDevice::read() index={}, whole_blocks={}, remaining={}", index, whole_blocks, remaining);
klog() << "StorageDevice::read() index=" << index << " whole_blocks=" << whole_blocks << " remaining=" << remaining;
#endif
if (whole_blocks > 0) { if (whole_blocks > 0) {
auto read_request = make_request<AsyncBlockDeviceRequest>(AsyncBlockDeviceRequest::Read, index, whole_blocks, outbuf, whole_blocks * block_size()); 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; remaining = 0;
} }
#if STORAGE_DEVICE_DEBUG dbgln_if(STORAGE_DEVICE_DEBUG, "StorageDevice::write() index={}, whole_blocks={}, remaining={}", index, whole_blocks, remaining);
klog() << "StorageDevice::write() index=" << index << " whole_blocks=" << whole_blocks << " remaining=" << remaining;
#endif
if (whole_blocks > 0) { if (whole_blocks > 0) {
auto write_request = make_request<AsyncBlockDeviceRequest>(AsyncBlockDeviceRequest::Write, index, whole_blocks, inbuf, whole_blocks * block_size()); auto write_request = make_request<AsyncBlockDeviceRequest>(AsyncBlockDeviceRequest::Write, index, whole_blocks, inbuf, whole_blocks * block_size());