1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-16 19:45:07 +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:
Liav A 2023-04-05 13:21:11 +03:00 committed by Linus Groh
parent dd7633c5f4
commit b02ee664e7
114 changed files with 230 additions and 218 deletions

View file

@ -93,7 +93,6 @@ ErrorOr<void> DisplayConnector::allocate_framebuffer_resources(size_t rounded_si
ErrorOr<void> DisplayConnector::after_inserting()
{
after_inserting_add_to_device_management();
ArmedScopeGuard clean_from_device_management([&] {
before_will_be_destroyed_remove_from_device_management();
});
@ -110,6 +109,7 @@ ErrorOr<void> DisplayConnector::after_inserting()
auto sys_fs_component = TRY(SysFSSymbolicLinkDeviceComponent::try_create(SysFSCharacterDevicesDirectory::the(), *this, *m_sysfs_device_directory));
m_symlink_sysfs_component = sys_fs_component;
after_inserting_add_symlink_to_device_identifier_directory();
ArmedScopeGuard clean_symlink_to_device_identifier_directory([&] {
VERIFY(m_symlink_sysfs_component);
before_will_be_destroyed_remove_symlink_from_device_identifier_directory();
@ -136,6 +136,7 @@ ErrorOr<void> DisplayConnector::after_inserting()
if (m_enable_write_combine_optimization) {
[[maybe_unused]] auto result = m_framebuffer_region->set_write_combine(true);
}
after_inserting_add_to_device_management();
return {};
}