diff options
| author | Felix Morgner <felix.morgner@ost.ch> | 2026-07-03 09:32:30 +0200 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@ost.ch> | 2026-07-03 09:32:30 +0200 |
| commit | 3012fa5dfe5dfed5e83baf9b40934ed8e8317627 (patch) | |
| tree | 00d1c60a3d5d1cdfa55e0ff1691cd3362b6064ee /kernel/src/filesystem/mount.cpp | |
| parent | 5d8a58d538515ffc57ddf82ba40ba763990a8696 (diff) | |
| download | kernel-3012fa5dfe5dfed5e83baf9b40934ed8e8317627.tar.xz kernel-3012fa5dfe5dfed5e83baf9b40934ed8e8317627.zip | |
kernel: rearrange sources according to p1204
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 |
