From a913d4c2cb4daf10c0eac4d548fccb26b2a9f099 Mon Sep 17 00:00:00 2001 From: Alexis211 Date: Sat, 28 Nov 2009 14:01:27 +0100 Subject: Fixed some stuff --- Source/Kernel/VFS/BlockCache.class.cpp | 10 +++++----- Source/Kernel/VFS/Partition.class.cpp | 2 +- Source/Kernel/VFS/Partition.class.h | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'Source/Kernel/VFS') diff --git a/Source/Kernel/VFS/BlockCache.class.cpp b/Source/Kernel/VFS/BlockCache.class.cpp index 458faf6..d505a99 100644 --- a/Source/Kernel/VFS/BlockCache.class.cpp +++ b/Source/Kernel/VFS/BlockCache.class.cpp @@ -17,7 +17,7 @@ BlockCache::~BlockCache() { template void BlockCache::sync() { for (u32int i = 0; i < m_count; i++) { - if (m_cacheInfo[i].dirty) m_dev->writeBlocks(m_cacheInfo[i].id, 1, m_cache + (i * m_dev->getBlockSize())); + if (m_cacheInfo[i].dirty) m_dev->writeBlocks(m_cacheInfo[i].id, 1, m_cache + (i * m_dev->blockSize())); } } @@ -30,7 +30,7 @@ void BlockCache::init(u32int count) { m_cacheInfo[i].lastuse = 0; m_cacheInfo[i].dirty = false; } - m_cache = (u8int*)Mem::alloc(m_count * m_dev->getBlockSize()); + m_cache = (u8int*)Mem::alloc(m_count * m_dev->blockSize()); } template @@ -45,11 +45,11 @@ bool BlockCache::setCache(u64int block, u8int* data, bool dirty) { } if (best >= m_count) return false; if (m_cacheInfo[best].dirty && (m_cacheInfo[best].id != block or !dirty)) - m_dev->writeBlocks(m_cacheInfo[best].id, 1, m_cache + (best * m_dev->getBlockSize())); + m_dev->writeBlocks(m_cacheInfo[best].id, 1, m_cache + (best * m_dev->blockSize())); m_cacheInfo[best].id = block; m_cacheInfo[best].lastuse = Time::uptime(); m_cacheInfo[best].dirty = dirty; - memcpy(m_cache + (best * m_dev->getBlockSize()), data, m_dev->getBlockSize()); + memcpy(m_cache + (best * m_dev->blockSize()), data, m_dev->blockSize()); return true; } @@ -58,7 +58,7 @@ bool BlockCache::getCache(u64int block, u8int* data) { for (u32int i = 0; i < m_count; i++) { if (m_cacheInfo[i].id == block && m_cacheInfo[i].lastuse != 0) { m_cacheInfo[i].lastuse = Time::uptime(); - memcpy(data, m_cache + (i * m_dev->getBlockSize()), m_dev->getBlockSize()); + memcpy(data, m_cache + (i * m_dev->blockSize()), m_dev->blockSize()); return true; } } diff --git a/Source/Kernel/VFS/Partition.class.cpp b/Source/Kernel/VFS/Partition.class.cpp index 1476b14..8d7de9b 100644 --- a/Source/Kernel/VFS/Partition.class.cpp +++ b/Source/Kernel/VFS/Partition.class.cpp @@ -67,4 +67,4 @@ BlockDevice* Partition::getDevice() { return m_device; } u64int Partition::getStartBlock() { return m_startblock; } u64int Partition::getBlockCount() { return m_blockcount; } u8int Partition::getPartNumber() { return m_partnumber; } -u32int Partition::getBlockSize() { return m_device->blockSize(); } +u32int Partition::blockSize() { return m_device->blockSize(); } diff --git a/Source/Kernel/VFS/Partition.class.h b/Source/Kernel/VFS/Partition.class.h index f511074..eb0aafd 100644 --- a/Source/Kernel/VFS/Partition.class.h +++ b/Source/Kernel/VFS/Partition.class.h @@ -26,7 +26,7 @@ class Partition { u64int getStartBlock(); u64int getBlockCount(); u8int getPartNumber(); - u32int getBlockSize(); + u32int blockSize(); inline u64int blocks() { return getBlockCount(); } }; -- cgit v1.2.3