mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-16 08:02:52 +00:00
Kernel: Get rid of *LockRefPtr in the SysFS filesystem code
To do this we also need to get rid of LockRefPtrs in the USB code as well. Most of the SysFS nodes are statically generated during boot and are not mutated afterwards. The same goes for general device code - once we generate the appropriate SysFS nodes, we almost never mutate the node pointers afterwards, making locking unnecessary.
This commit is contained in:
parent
dd7633c5f4
commit
b02ee664e7
Notes:
sideshowbarker
2024-07-17 06:45:52 +09:00
Author: https://github.com/supercomputer7
Commit: b02ee664e7
Pull-request: https://github.com/SerenityOS/serenity/pull/18190
Reviewed-by: https://github.com/awesomekling
114 changed files with 230 additions and 218 deletions
|
@ -20,9 +20,9 @@ SysFSDeviceIdentifiersDirectory& SysFSDeviceIdentifiersDirectory::the()
|
|||
return *s_the;
|
||||
}
|
||||
|
||||
UNMAP_AFTER_INIT NonnullLockRefPtr<SysFSDeviceIdentifiersDirectory> SysFSDeviceIdentifiersDirectory::must_create(SysFSRootDirectory const& root_directory)
|
||||
UNMAP_AFTER_INIT NonnullRefPtr<SysFSDeviceIdentifiersDirectory> SysFSDeviceIdentifiersDirectory::must_create(SysFSRootDirectory const& root_directory)
|
||||
{
|
||||
auto devices_directory = adopt_lock_ref_if_nonnull(new SysFSDeviceIdentifiersDirectory(root_directory)).release_nonnull();
|
||||
auto devices_directory = adopt_ref_if_nonnull(new SysFSDeviceIdentifiersDirectory(root_directory)).release_nonnull();
|
||||
MUST(devices_directory->m_child_components.with([&](auto& list) -> ErrorOr<void> {
|
||||
list.append(SysFSBlockDevicesDirectory::must_create(*devices_directory));
|
||||
list.append(SysFSCharacterDevicesDirectory::must_create(*devices_directory));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue