1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-11 07:12:07 +00:00

Ext2FS: Implement writing into inodes with arbitrary offset and length.

Okay, this is pretty cool. :^) There are some issues and limitations for
sure but the basic functionality is there.
This commit is contained in:
Andreas Kling 2019-01-23 04:29:56 +01:00
parent 29dfb4ae13
commit 906685e238
8 changed files with 147 additions and 19 deletions

View file

@ -15,10 +15,10 @@ DiskBackedFS::~DiskBackedFS()
bool DiskBackedFS::writeBlock(unsigned index, const ByteBuffer& data)
{
ASSERT(data.size() == blockSize());
#ifdef DBFS_DEBUG
kprintf("DiskBackedFileSystem::writeBlock %u\n", index);
kprintf("DiskBackedFileSystem::writeBlock %u, size=%u\n", index, data.size());
#endif
ASSERT(data.size() == blockSize());
DiskOffset baseOffset = static_cast<DiskOffset>(index) * static_cast<DiskOffset>(blockSize());
return device().write(baseOffset, blockSize(), data.pointer());
}