#include "kernel/filesystem/dentry.hpp" #include "kapi/system.hpp" #include "kernel/filesystem/inode.hpp" #include #include namespace filesystem { dentry::dentry(kstd::shared_ptr const & parent, kstd::shared_ptr const & node) : m_parent(parent) , m_inode(node) { if (!m_inode) { kapi::system::panic("[FILESYSTEM] dentry constructed with null inode."); } } auto dentry::get_inode() const -> kstd::shared_ptr const & { return m_inode; } auto dentry::get_parent() const -> kstd::shared_ptr const & { return m_parent; } auto dentry::set_flag(dentry_flags flag) -> void { m_flags |= static_cast(flag); } auto dentry::unset_flag(dentry_flags flag) -> void { m_flags &= ~static_cast(flag); } auto dentry::has_flag(dentry_flags flag) const -> bool { return (m_flags & static_cast(flag)) != 0; } } // namespace filesystem