mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 23:17:45 +00:00
Kernel: Allow Ext2FS::flush_writes() to return ErrorOr<void>
This commit is contained in:
parent
28cda85f1f
commit
abcf05801a
8 changed files with 26 additions and 12 deletions
|
@ -662,7 +662,7 @@ void Ext2FS::flush_block_group_descriptor_table()
|
|||
}
|
||||
}
|
||||
|
||||
void Ext2FS::flush_writes()
|
||||
ErrorOr<void> Ext2FS::flush_writes()
|
||||
{
|
||||
{
|
||||
MutexLocker locker(m_lock);
|
||||
|
@ -670,8 +670,7 @@ void Ext2FS::flush_writes()
|
|||
auto result = flush_super_block();
|
||||
if (result.is_error()) {
|
||||
dbgln("Ext2FS[{}]::flush_writes(): Failed to write superblock: {}", fsid(), result.error());
|
||||
// FIXME: We should handle this error.
|
||||
VERIFY_NOT_REACHED();
|
||||
return result.release_error();
|
||||
}
|
||||
m_super_block_dirty = false;
|
||||
}
|
||||
|
@ -708,7 +707,13 @@ void Ext2FS::flush_writes()
|
|||
});
|
||||
}
|
||||
|
||||
BlockBasedFileSystem::flush_writes();
|
||||
auto result = BlockBasedFileSystem::flush_writes();
|
||||
if (result.is_error()) {
|
||||
dbgln("Ext2FS[{}]::flush_writes(): Failed to flush writes: {}", BlockBasedFileSystem::fsid(), result.error());
|
||||
return result.release_error();
|
||||
}
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
ErrorOr<NonnullRefPtr<Ext2FSInode>> Ext2FS::build_root_inode() const
|
||||
|
|
|
@ -77,7 +77,7 @@ private:
|
|||
ErrorOr<NonnullRefPtr<Inode>> get_inode(InodeIdentifier) const;
|
||||
ErrorOr<NonnullRefPtr<Inode>> create_inode(Ext2FSInode& parent_inode, StringView name, mode_t, dev_t, UserID, GroupID);
|
||||
ErrorOr<NonnullRefPtr<Inode>> create_directory(Ext2FSInode& parent_inode, StringView name, mode_t, UserID, GroupID);
|
||||
virtual void flush_writes() override;
|
||||
virtual ErrorOr<void> flush_writes() override;
|
||||
|
||||
BlockIndex first_block_index() const;
|
||||
BlockIndex first_block_of_block_group_descriptors() const;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue