mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:17:36 +00:00
Kernel: Convert klog() => AK::Format in DiskPartition
This commit is contained in:
parent
f9aace29ec
commit
8b0ebe3e30
1 changed files with 4 additions and 20 deletions
|
@ -60,44 +60,28 @@ void DiskPartition::start_request(AsyncBlockDeviceRequest& request)
|
||||||
KResultOr<size_t> DiskPartition::read(FileDescription& fd, size_t offset, UserOrKernelBuffer& outbuf, size_t len)
|
KResultOr<size_t> DiskPartition::read(FileDescription& fd, size_t offset, UserOrKernelBuffer& outbuf, size_t len)
|
||||||
{
|
{
|
||||||
unsigned adjust = m_metadata.start_block() * block_size();
|
unsigned adjust = m_metadata.start_block() * block_size();
|
||||||
|
dbgln_if(OFFD_DEBUG, "DiskPartition::read offset={}, adjust={}, len={}", fd.offset(), adjust, len);
|
||||||
#if OFFD_DEBUG
|
|
||||||
klog() << "DiskPartition::read offset=" << fd.offset() << " adjust=" << adjust << " len=" << len;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return m_device->read(fd, offset + adjust, outbuf, len);
|
return m_device->read(fd, offset + adjust, outbuf, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DiskPartition::can_read(const FileDescription& fd, size_t offset) const
|
bool DiskPartition::can_read(const FileDescription& fd, size_t offset) const
|
||||||
{
|
{
|
||||||
unsigned adjust = m_metadata.start_block() * block_size();
|
unsigned adjust = m_metadata.start_block() * block_size();
|
||||||
|
dbgln_if(OFFD_DEBUG, "DiskPartition::can_read offset={}, adjust={}", offset, adjust);
|
||||||
#if OFFD_DEBUG
|
|
||||||
klog() << "DiskPartition::can_read offset=" << offset << " adjust=" << adjust;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return m_device->can_read(fd, offset + adjust);
|
return m_device->can_read(fd, offset + adjust);
|
||||||
}
|
}
|
||||||
|
|
||||||
KResultOr<size_t> DiskPartition::write(FileDescription& fd, size_t offset, const UserOrKernelBuffer& inbuf, size_t len)
|
KResultOr<size_t> DiskPartition::write(FileDescription& fd, size_t offset, const UserOrKernelBuffer& inbuf, size_t len)
|
||||||
{
|
{
|
||||||
unsigned adjust = m_metadata.start_block() * block_size();
|
unsigned adjust = m_metadata.start_block() * block_size();
|
||||||
|
dbgln_if(OFFD_DEBUG, "DiskPartition::write offset={}, adjust={}, len={}", offset, adjust, len);
|
||||||
#if OFFD_DEBUG
|
|
||||||
klog() << "DiskPartition::write offset=" << offset << " adjust=" << adjust << " len=" << len;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return m_device->write(fd, offset + adjust, inbuf, len);
|
return m_device->write(fd, offset + adjust, inbuf, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DiskPartition::can_write(const FileDescription& fd, size_t offset) const
|
bool DiskPartition::can_write(const FileDescription& fd, size_t offset) const
|
||||||
{
|
{
|
||||||
unsigned adjust = m_metadata.start_block() * block_size();
|
unsigned adjust = m_metadata.start_block() * block_size();
|
||||||
|
dbgln_if(OFFD_DEBUG, "DiskPartition::can_write offset={}, adjust={}", offset, adjust);
|
||||||
#if OFFD_DEBUG
|
|
||||||
klog() << "DiskPartition::can_write offset=" << offset << " adjust=" << adjust;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return m_device->can_write(fd, offset + adjust);
|
return m_device->can_write(fd, offset + adjust);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue