aboutsummaryrefslogtreecommitdiff
path: root/kernel/src/filesystem/mount.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/src/filesystem/mount.cpp')
-rw-r--r--kernel/src/filesystem/mount.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/kernel/src/filesystem/mount.cpp b/kernel/src/filesystem/mount.cpp
new file mode 100644
index 0000000..a2c501f
--- /dev/null
+++ b/kernel/src/filesystem/mount.cpp
@@ -0,0 +1,32 @@
+#include "kernel/filesystem/mount.hpp"
+
+#include "kapi/system.hpp"
+
+#include "kernel/filesystem/filesystem.hpp"
+
+#include <kstd/memory>
+
+#include <string_view>
+
+namespace filesystem
+{
+ mount::mount(std::string_view const & path, kstd::shared_ptr<filesystem> const & fs)
+ : m_path(path)
+ , m_filesystem(fs)
+ {
+ if (!m_filesystem)
+ {
+ kapi::system::panic("[FILESYSTEM] mount initialized with null filesystem.");
+ }
+ }
+
+ auto mount::path() const -> std::string_view
+ {
+ return m_path;
+ }
+
+ auto mount::get_filesystem() const -> kstd::shared_ptr<filesystem> const &
+ {
+ return m_filesystem;
+ }
+} // namespace filesystem \ No newline at end of file