aboutsummaryrefslogtreecommitdiff
path: root/kernel/filesystem/src/mount.cpp
blob: 021b0748db243fb57c1ab96df5410390a85ca4b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include "filesystem/mount.hpp"

#include "kapi/system.hpp"

#include "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