Kernel/Ext2FS: Cache the root inode in a member variable

We often get queried for the root inode, and it will always be cached
in memory anyway, so let's make Ext2FS::root_inode() fast by keeping
the root inode in a dedicated member variable.
This commit is contained in:
Andreas Kling 2021-07-18 01:29:54 +02:00
commit 58c6d30f6a
Notes: sideshowbarker 2024-07-18 08:50:45 +09:00
4 changed files with 13 additions and 4 deletions

View file

@ -43,7 +43,7 @@ public:
virtual unsigned total_inode_count() const { return 0; }
virtual unsigned free_inode_count() const { return 0; }
virtual KResult prepare_to_unmount() const { return KSuccess; }
virtual KResult prepare_to_unmount() { return KSuccess; }
struct DirectoryEntryView {
DirectoryEntryView(const StringView& name, InodeIdentifier, u8 file_type);