1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-23 23:05: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

@ -280,6 +280,17 @@ bool SynthFSInode::write(const ByteBuffer& data)
return m_write_callback(*this, data);
}
ssize_t SynthFSInode::write_bytes(Unix::off_t offset, size_t size, const byte* buffer, FileDescriptor*)
{
if (!m_write_callback)
return -EPERM;
// FIXME: Being able to write into SynthFS at a non-zero offset seems like something we should support..
ASSERT(offset == 0);
bool success = m_write_callback(*this, ByteBuffer::wrap((byte*)buffer, size));
ASSERT(success);
return 0;
}
bool SynthFSInode::add_child(InodeIdentifier child_id, const String& name, byte file_type, int& error)
{
(void) child_id;