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:
parent
29dfb4ae13
commit
906685e238
8 changed files with 147 additions and 19 deletions
|
@ -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());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue