mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
Kernel: Ensure we flush the entire ext2 superblock
This commit is contained in:
parent
061badeaea
commit
65dd9d5ad3
Notes:
sideshowbarker
2024-07-19 07:50:58 +09:00
Author: https://github.com/supercomputer7
Commit: 65dd9d5ad3
Pull-request: https://github.com/SerenityOS/serenity/pull/1668
3 changed files with 26 additions and 2 deletions
|
@ -168,6 +168,25 @@ bool FileBackedFS::raw_write(unsigned index, const u8* buffer)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool FileBackedFS::raw_read_blocks(unsigned index, size_t count, u8* buffer)
|
||||
{
|
||||
for (unsigned block = index; block < (index + count); block++) {
|
||||
if (!raw_read(block, buffer))
|
||||
return false;
|
||||
buffer += logical_block_size();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
bool FileBackedFS::raw_write_blocks(unsigned index, size_t count, const u8* buffer)
|
||||
{
|
||||
for (unsigned block = index; block < (index + count); block++) {
|
||||
if (!raw_write(block, buffer))
|
||||
return false;
|
||||
buffer += logical_block_size();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool FileBackedFS::write_blocks(unsigned index, unsigned count, const u8* data, FileDescription* description)
|
||||
{
|
||||
ASSERT(m_logical_block_size);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue