From da7ae52eeef1c547af73b4a1918b69246631d4f8 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 17 Aug 2019 13:49:37 +0200 Subject: [PATCH] Ext2FS: Clean up prepare_to_unmount() a little bit --- Kernel/FileSystem/Ext2FileSystem.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Kernel/FileSystem/Ext2FileSystem.cpp b/Kernel/FileSystem/Ext2FileSystem.cpp index 9fa73c2500..842e11dc15 100644 --- a/Kernel/FileSystem/Ext2FileSystem.cpp +++ b/Kernel/FileSystem/Ext2FileSystem.cpp @@ -1398,13 +1398,13 @@ unsigned Ext2FS::free_inode_count() const KResult Ext2FS::prepare_to_unmount() const { - LOCKER(m_lock); // Acquire lock for this FS - for (auto it = m_inode_cache.begin(); it != m_inode_cache.end(); ++it) { - if (it->value.ptr()->ref_count() > 1) + LOCKER(m_lock); + + for (auto& it : m_inode_cache) { + if (it.value->ref_count() > 1) return KResult(-EBUSY); } - dbg() << "here!"; m_inode_cache.clear(); return KSuccess; }