1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 05:27:43 +00:00

Kernel/Ext2FS: Don't hog FS lock when calling base class flush_writes()

Once we've finalized all the file system metadata in flush_writes(),
we no longer need to hold the file system lock during the call to
BlockBasedFileSystem::flush_writes().
This commit is contained in:
Andreas Kling 2021-07-16 02:16:00 +02:00
parent 98c230b370
commit abbd237ec1

View file

@ -687,6 +687,7 @@ void Ext2FS::flush_block_group_descriptor_table()
} }
void Ext2FS::flush_writes() void Ext2FS::flush_writes()
{
{ {
Locker locker(m_lock); Locker locker(m_lock);
if (m_super_block_dirty) { if (m_super_block_dirty) {
@ -708,8 +709,6 @@ void Ext2FS::flush_writes()
} }
} }
BlockBasedFileSystem::flush_writes();
// Uncache Inodes that are only kept alive by the index-to-inode lookup cache. // Uncache Inodes that are only kept alive by the index-to-inode lookup cache.
// We don't uncache Inodes that are being watched by at least one InodeWatcher. // We don't uncache Inodes that are being watched by at least one InodeWatcher.
@ -735,6 +734,9 @@ void Ext2FS::flush_writes()
uncache_inode(index); uncache_inode(index);
} }
BlockBasedFileSystem::flush_writes();
}
Ext2FSInode::Ext2FSInode(Ext2FS& fs, InodeIndex index) Ext2FSInode::Ext2FSInode(Ext2FS& fs, InodeIndex index)
: Inode(fs, index) : Inode(fs, index)
{ {