diff options
Diffstat (limited to 'kernel/src/filesystem/mount.cpp')
| -rw-r--r-- | kernel/src/filesystem/mount.cpp | 90 |
1 files changed, 0 insertions, 90 deletions
diff --git a/kernel/src/filesystem/mount.cpp b/kernel/src/filesystem/mount.cpp deleted file mode 100644 index ead7479d..00000000 --- a/kernel/src/filesystem/mount.cpp +++ /dev/null @@ -1,90 +0,0 @@ -#include <kernel/filesystem/mount.hpp> - -#include <kernel/filesystem/dentry.hpp> -#include <kernel/filesystem/filesystem.hpp> - -#include <kapi/system.hpp> - -#include <kstd/memory> -#include <kstd/string> - -#include <cstddef> -#include <string_view> - -namespace kernel::filesystem -{ - mount::mount(kstd::shared_ptr<dentry> const & mount_dentry, kstd::shared_ptr<dentry> const & root_dentry, - kstd::shared_ptr<filesystem> const & fs, kstd::shared_ptr<mount> const & parent_mount, - kstd::shared_ptr<mount> const & source_mount) - : m_mount_dentry(mount_dentry) - , m_root_dentry(root_dentry) - , m_filesystem(fs) - , m_parent_mount(parent_mount) - , m_source_mount(source_mount) - , m_ref_count(0) - { - if (!m_filesystem) - { - kapi::system::panic("[FILESYSTEM] mount initialized with null filesystem."); - } - } - - auto mount::mount_dentry() const -> kstd::shared_ptr<dentry> const & - { - return m_mount_dentry; - } - - auto mount::get_filesystem() const -> kstd::shared_ptr<filesystem> const & - { - return m_filesystem; - } - - auto mount::root_dentry() const -> kstd::shared_ptr<dentry> const & - { - return m_root_dentry; - } - - auto mount::mount_path() const -> kstd::string - { - if (m_mount_dentry) - { - return m_mount_dentry->absolute_path(); - } - return "/"; - } - - auto mount::parent_mount() const -> kstd::shared_ptr<mount> const & - { - return m_parent_mount; - } - - auto mount::source_mount() const -> kstd::shared_ptr<mount> - { - return m_source_mount.lock(); - } - - auto mount::increment_ref_count() -> void - { - m_ref_count += 1; - } - - auto mount::decrement_ref_count() -> void - { - if (m_ref_count == 0) - { - kapi::system::panic("[FILESYSTEM] decrement_ref_count() was called but ref_count is 0"); - } - - m_ref_count -= 1; - } - - auto mount::is_ready_to_unmount() const -> bool - { - return m_ref_count == 0; - } - - auto mount::ref_count() const -> size_t - { - return m_ref_count; - } -} // namespace kernel::filesystem
\ No newline at end of file |
