mirror of
https://github.com/RGBCube/serenity
synced 2025-05-20 00:15:08 +00:00
Kernel: Split the ProcFS core file into smaller components
This commit is contained in:
parent
e882b2ed05
commit
3906dd3aa3
30 changed files with 1080 additions and 822 deletions
36
Kernel/FileSystem/ProcFS/LinkInode.cpp
Normal file
36
Kernel/FileSystem/ProcFS/LinkInode.cpp
Normal file
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org>
|
||||
* Copyright (c) 2021, Spencer Dixon <spencercdixon@gmail.com>
|
||||
* Copyright (c) 2021, Liav A. <liavalb@hotmail.co.il>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <Kernel/FileSystem/ProcFS/LinkInode.h>
|
||||
|
||||
namespace Kernel {
|
||||
|
||||
ErrorOr<NonnullLockRefPtr<ProcFSLinkInode>> ProcFSLinkInode::try_create(ProcFS const& procfs, ProcFSExposedComponent const& component)
|
||||
{
|
||||
return adopt_nonnull_lock_ref_or_enomem(new (nothrow) ProcFSLinkInode(procfs, component));
|
||||
}
|
||||
|
||||
ProcFSLinkInode::ProcFSLinkInode(ProcFS const& fs, ProcFSExposedComponent const& component)
|
||||
: ProcFSGlobalInode(fs, component)
|
||||
{
|
||||
}
|
||||
|
||||
InodeMetadata ProcFSLinkInode::metadata() const
|
||||
{
|
||||
MutexLocker locker(m_inode_lock);
|
||||
InodeMetadata metadata;
|
||||
metadata.inode = { fsid(), m_associated_component->component_index() };
|
||||
metadata.mode = S_IFLNK | m_associated_component->required_mode();
|
||||
metadata.uid = m_associated_component->owner_user();
|
||||
metadata.gid = m_associated_component->owner_group();
|
||||
metadata.size = 0;
|
||||
metadata.mtime = m_associated_component->modified_time();
|
||||
return metadata;
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue