mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
Kernel/SysFS: Remove unnecessary mutex lockers in SysFS metadata getters
SysFS inodes have immutable metadata once created.
This commit is contained in:
parent
8ebf08b6c8
commit
244ede561b
Notes:
sideshowbarker
2024-07-18 05:06:57 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/244ede561b3
1 changed files with 2 additions and 2 deletions
|
@ -113,7 +113,7 @@ KResultOr<NonnullRefPtr<Inode>> SysFSInode::lookup(StringView)
|
|||
|
||||
InodeMetadata SysFSInode::metadata() const
|
||||
{
|
||||
MutexLocker locker(m_inode_lock);
|
||||
// NOTE: No locking required as m_associated_component or its component index will never change during our lifetime.
|
||||
InodeMetadata metadata;
|
||||
metadata.inode = { fsid(), m_associated_component->component_index() };
|
||||
metadata.mode = S_IFREG | S_IRUSR | S_IRGRP | S_IROTH;
|
||||
|
@ -179,7 +179,7 @@ SysFSDirectoryInode::~SysFSDirectoryInode()
|
|||
|
||||
InodeMetadata SysFSDirectoryInode::metadata() const
|
||||
{
|
||||
MutexLocker locker(m_inode_lock);
|
||||
// NOTE: No locking required as m_associated_component or its component index will never change during our lifetime.
|
||||
InodeMetadata metadata;
|
||||
metadata.inode = { fsid(), m_associated_component->component_index() };
|
||||
metadata.mode = S_IFDIR | S_IRUSR | S_IRGRP | S_IROTH | S_IXOTH;
|
||||
|
|
Loading…
Reference in a new issue