summaryrefslogtreecommitdiff
path: root/Source/Kernel/VFS
diff options
context:
space:
mode:
authorAlexis211 <alexis211@gmail.com>2009-11-28 14:01:27 +0100
committerAlexis211 <alexis211@gmail.com>2009-11-28 14:01:27 +0100
commita913d4c2cb4daf10c0eac4d548fccb26b2a9f099 (patch)
tree6573d49f1cf4a88e8af4a82ee4bf566925233b67 /Source/Kernel/VFS
parent4d0939e2853ffd9d49b83524923351f9776866d7 (diff)
downloadMelon-a913d4c2cb4daf10c0eac4d548fccb26b2a9f099.tar.gz
Melon-a913d4c2cb4daf10c0eac4d548fccb26b2a9f099.zip
Fixed some stuff
Diffstat (limited to 'Source/Kernel/VFS')
-rw-r--r--Source/Kernel/VFS/BlockCache.class.cpp10
-rw-r--r--Source/Kernel/VFS/Partition.class.cpp2
-rw-r--r--Source/Kernel/VFS/Partition.class.h2
3 files changed, 7 insertions, 7 deletions
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<T>::~BlockCache() {
template <typename T>
void BlockCache<T>::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<T>::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 <typename T>
@@ -45,11 +45,11 @@ bool BlockCache<T>::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<T>::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(); }
};