1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 08:07:44 +00:00

Kernel: Rename offset parameter of OffsetDiskDevice to block_offset

This commit is contained in:
Conrad Pankoff 2019-06-02 19:29:17 +10:00 committed by Andreas Kling
parent b094fe3f2f
commit 8eb492aa11
2 changed files with 14 additions and 14 deletions

View file

@ -2,13 +2,13 @@
// #define OFFD_DEBUG // #define OFFD_DEBUG
Retained<OffsetDiskDevice> OffsetDiskDevice::create(Retained<DiskDevice>&& device, unsigned offset) Retained<OffsetDiskDevice> OffsetDiskDevice::create(Retained<DiskDevice>&& device, unsigned block_offset)
{ {
return adopt(*new OffsetDiskDevice(move(device), offset)); return adopt(*new OffsetDiskDevice(move(device), block_offset));
} }
OffsetDiskDevice::OffsetDiskDevice(Retained<DiskDevice>&& device, unsigned offset) OffsetDiskDevice::OffsetDiskDevice(Retained<DiskDevice>&& device, unsigned block_offset)
: m_device(move(device)), m_offset(offset) : m_device(move(device)), m_block_offset(block_offset)
{ {
} }
@ -24,37 +24,37 @@ unsigned OffsetDiskDevice::block_size() const
bool OffsetDiskDevice::read_block(unsigned index, byte* out) const bool OffsetDiskDevice::read_block(unsigned index, byte* out) const
{ {
#ifdef OFFD_DEBUG #ifdef OFFD_DEBUG
kprintf("OffsetDiskDevice::read_block %u (really: %u)\n", index, m_offset + index); kprintf("OffsetDiskDevice::read_block %u (really: %u)\n", index, m_block_offset + index);
#endif #endif
return m_device->read_block(m_offset + index, out); return m_device->read_block(m_block_offset + index, out);
} }
bool OffsetDiskDevice::write_block(unsigned index, const byte* data) bool OffsetDiskDevice::write_block(unsigned index, const byte* data)
{ {
#ifdef OFFD_DEBUG #ifdef OFFD_DEBUG
kprintf("OffsetDiskDevice::write_block %u (really: %u)\n", index, m_offset + index); kprintf("OffsetDiskDevice::write_block %u (really: %u)\n", index, m_block_offset + index);
#endif #endif
return m_device->write_block(m_offset + index, data); return m_device->write_block(m_block_offset + index, data);
} }
bool OffsetDiskDevice::read_blocks(unsigned index, word count, byte* out) bool OffsetDiskDevice::read_blocks(unsigned index, word count, byte* out)
{ {
#ifdef OFFD_DEBUG #ifdef OFFD_DEBUG
kprintf("OffsetDiskDevice::read_blocks %u (really: %u) count=%u\n", index, m_offset + index, count); kprintf("OffsetDiskDevice::read_blocks %u (really: %u) count=%u\n", index, m_block_offset + index, count);
#endif #endif
return m_device->read_blocks(m_offset + index, count, out); return m_device->read_blocks(m_block_offset + index, count, out);
} }
bool OffsetDiskDevice::write_blocks(unsigned index, word count, const byte* data) bool OffsetDiskDevice::write_blocks(unsigned index, word count, const byte* data)
{ {
#ifdef OFFD_DEBUG #ifdef OFFD_DEBUG
kprintf("OffsetDiskDevice::write_blocks %u (really: %u) count=%u\n", index, m_offset + index, count); kprintf("OffsetDiskDevice::write_blocks %u (really: %u) count=%u\n", index, m_block_offset + index, count);
#endif #endif
return m_device->write_blocks(m_offset + index, count, data); return m_device->write_blocks(m_block_offset + index, count, data);
} }
const char* OffsetDiskDevice::class_name() const const char* OffsetDiskDevice::class_name() const

View file

@ -5,7 +5,7 @@
class OffsetDiskDevice final : public DiskDevice { class OffsetDiskDevice final : public DiskDevice {
public: public:
static Retained<OffsetDiskDevice> create(Retained<DiskDevice>&& device, unsigned offset); static Retained<OffsetDiskDevice> create(Retained<DiskDevice>&& device, unsigned block_offset);
virtual ~OffsetDiskDevice(); virtual ~OffsetDiskDevice();
virtual unsigned block_size() const override; virtual unsigned block_size() const override;
@ -20,5 +20,5 @@ private:
OffsetDiskDevice(Retained<DiskDevice>&&, unsigned); OffsetDiskDevice(Retained<DiskDevice>&&, unsigned);
Retained<DiskDevice> m_device; Retained<DiskDevice> m_device;
unsigned m_offset; unsigned m_block_offset;
}; };