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