2020-01-18 05:38:21 -03:00
|
|
|
/*
|
2021-07-10 19:33:27 -03:00
|
|
|
* Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org>
|
2020-01-18 05:38:21 -03:00
|
|
|
*
|
2021-04-22 05:24:48 -03:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-01-18 05:38:21 -03:00
|
|
|
*/
|
|
|
|
|
|
2020-04-06 05:54:21 -03:00
|
|
|
#include <Kernel/FileSystem/FileBackedFileSystem.h>
|
2018-10-10 06:53:07 -03:00
|
|
|
|
2020-02-15 21:27:42 -03:00
|
|
|
namespace Kernel {
|
|
|
|
|
|
2021-09-07 08:39:11 -03:00
|
|
|
FileBackedFileSystem::FileBackedFileSystem(OpenFileDescription& file_description)
|
2020-04-06 05:54:21 -03:00
|
|
|
: m_file_description(file_description)
|
2018-10-10 06:53:07 -03:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2022-03-16 16:15:15 -03:00
|
|
|
FileBackedFileSystem::~FileBackedFileSystem() = default;
|
2018-10-10 06:53:07 -03:00
|
|
|
|
2022-08-19 18:03:24 -03:00
|
|
|
ErrorOr<void> FileBackedFileSystem::initialize()
|
|
|
|
|
{
|
|
|
|
|
MutexLocker locker(m_lock);
|
|
|
|
|
if (is_initialized_while_locked())
|
|
|
|
|
return {};
|
|
|
|
|
return initialize_while_locked();
|
|
|
|
|
}
|
|
|
|
|
|
2020-02-15 21:27:42 -03:00
|
|
|
}
|