X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=KernelLand%2FModules%2FFilesystems%2FExt2%2Fwrite.c;h=22e256bfc3cf76d87136d66afd55a05ab4c362bd;hb=a61bac5494200989c64275b8c8e4bb975494d924;hp=03109e8a91ea27f9e65942ef2506f791926998b5;hpb=48743e39650eb1ef988380e9d95f27fd40d3a9ce;p=tpg%2Facess2.git diff --git a/KernelLand/Modules/Filesystems/Ext2/write.c b/KernelLand/Modules/Filesystems/Ext2/write.c index 03109e8a..22e256bf 100644 --- a/KernelLand/Modules/Filesystems/Ext2/write.c +++ b/KernelLand/Modules/Filesystems/Ext2/write.c @@ -18,10 +18,9 @@ void Ext2_int_DeallocateBlock(tExt2_Disk *Disk, Uint32 Block); // === CODE === /** - * \fn Uint64 Ext2_Write(tVFS_Node *Node, Uint64 Offset, Uint64 Length, void *Buffer) * \brief Write to a file */ -Uint64 Ext2_Write(tVFS_Node *Node, Uint64 Offset, Uint64 Length, const void *Buffer) +size_t Ext2_Write(tVFS_Node *Node, off_t Offset, size_t Length, const void *Buffer) { tExt2_Disk *disk = Node->ImplPtr; tExt2_Inode inode; @@ -120,7 +119,12 @@ addBlocks: } base = block * disk->BlockSize; VFS_WriteAt(disk->FD, base, retLen, Buffer); + + // TODO: When should the size update be committed? inode.i_size += retLen; + Node->Size += retLen; + Node->Flags |= VFS_FFLAG_DIRTY; + retLen = 0; ret: // Makes sure the changes to the inode are committed