MCPcopy Create free account
hub / github.com/LemonOSProject/LemonOS / WriteSuperblock

Method WriteSuperblock

Kernel/src/fs/ext2.cpp:117–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

115 }
116
117 void Ext2Volume::WriteSuperblock(){
118 uint8_t buffer[blocksize];
119
120 uint32_t superindex = LocationToBlock(EXT2_SUPERBLOCK_LOCATION);
121 if(ReadBlockCached(superindex, buffer)){
122 Log::Info("[Ext2] WriteBlock: Error reading block %d", superindex);
123 return;
124 }
125
126 memcpy(buffer + (EXT2_SUPERBLOCK_LOCATION % blocksize), &super, sizeof(ext2_superblock_t) + sizeof(ext2_superblock_extended_t));
127
128 if(WriteBlockCached(superindex, buffer)){
129 Log::Info("[Ext2] WriteBlock: Error writing block %d", superindex);
130 return;
131 }
132 }
133
134 void Ext2Volume::WriteBlockGroupDescriptor(uint32_t index){
135 uint32_t firstBlockGroup = LocationToBlock(EXT2_SUPERBLOCK_LOCATION) + 1;

Callers

nothing calls this directly

Calls 2

InfoFunction · 0.85
memcpyFunction · 0.85

Tested by

no test coverage detected