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

Kernel: Cache blocks_per_page in StorageDevice class

Instead of calculating blocks_per_page in every IO, cache it to save
CPU cycles as that value will not change after initialization.
This commit is contained in:
Pankaj Raghav 2022-01-29 11:51:21 +05:30 committed by Idan Horowitz
parent cf44d71edf
commit 3b27e28e67
2 changed files with 7 additions and 9 deletions

View file

@ -66,7 +66,8 @@ private:
// FIXME: Remove this method after figuring out another scheme for naming.
NonnullOwnPtr<KString> m_early_storage_device_name;
u64 m_max_addressable_block;
u64 m_max_addressable_block { 0 };
size_t m_blocks_per_page { 0 };
};
}