From 8eb492aa11c6030d2b5f65e97c9c6b55325f36fd Mon Sep 17 00:00:00 2001 From: Conrad Pankoff Date: Sun, 2 Jun 2019 19:29:17 +1000 Subject: [PATCH] Kernel: Rename offset parameter of OffsetDiskDevice to block_offset --- Kernel/Devices/OffsetDiskDevice.cpp | 24 ++++++++++++------------ Kernel/Devices/OffsetDiskDevice.h | 4 ++-- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Kernel/Devices/OffsetDiskDevice.cpp b/Kernel/Devices/OffsetDiskDevice.cpp index a09a26d916..74d66853c4 100644 --- a/Kernel/Devices/OffsetDiskDevice.cpp +++ b/Kernel/Devices/OffsetDiskDevice.cpp @@ -2,13 +2,13 @@ // #define OFFD_DEBUG -Retained OffsetDiskDevice::create(Retained&& device, unsigned offset) +Retained OffsetDiskDevice::create(Retained&& device, unsigned block_offset) { - return adopt(*new OffsetDiskDevice(move(device), offset)); + return adopt(*new OffsetDiskDevice(move(device), block_offset)); } -OffsetDiskDevice::OffsetDiskDevice(Retained&& device, unsigned offset) - : m_device(move(device)), m_offset(offset) +OffsetDiskDevice::OffsetDiskDevice(Retained&& device, unsigned block_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 { #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 - 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) { #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 - 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) { #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 - 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) { #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 - 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 diff --git a/Kernel/Devices/OffsetDiskDevice.h b/Kernel/Devices/OffsetDiskDevice.h index adb9046676..aaa2350319 100644 --- a/Kernel/Devices/OffsetDiskDevice.h +++ b/Kernel/Devices/OffsetDiskDevice.h @@ -5,7 +5,7 @@ class OffsetDiskDevice final : public DiskDevice { public: - static Retained create(Retained&& device, unsigned offset); + static Retained create(Retained&& device, unsigned block_offset); virtual ~OffsetDiskDevice(); virtual unsigned block_size() const override; @@ -20,5 +20,5 @@ private: OffsetDiskDevice(Retained&&, unsigned); Retained m_device; - unsigned m_offset; + unsigned m_block_offset; };