/* * Copyright (c) 2019-2020, Sergey Bugaev * Copyright (c) 2022-2023, Liav A. * * SPDX-License-Identifier: BSD-2-Clause */ #include #include namespace Kernel { ErrorOr> RAMFS::try_create() { return TRY(adopt_nonnull_lock_ref_or_enomem(new (nothrow) RAMFS)); } RAMFS::RAMFS() = default; RAMFS::~RAMFS() = default; ErrorOr RAMFS::initialize() { m_root_inode = TRY(RAMFSInode::try_create_root(*this)); return {}; } Inode& RAMFS::root_inode() { VERIFY(!m_root_inode.is_null()); return *m_root_inode; } unsigned RAMFS::next_inode_index() { MutexLocker locker(m_lock); return m_next_inode_index++; } }