From fbb4eefce7bf825b0406f6fa63de318153a3b95a Mon Sep 17 00:00:00 2001 From: "marcel.braun" Date: Mon, 23 Mar 2026 21:41:37 +0100 Subject: Implement resolve_path --- kernel/include/kernel/filesystem/dentry.hpp | 6 +++++- kernel/include/kernel/filesystem/open_file_description.hpp | 2 +- kernel/include/kernel/filesystem/vfs.hpp | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) (limited to 'kernel/include') diff --git a/kernel/include/kernel/filesystem/dentry.hpp b/kernel/include/kernel/filesystem/dentry.hpp index db15b48..ca7ca95 100644 --- a/kernel/include/kernel/filesystem/dentry.hpp +++ b/kernel/include/kernel/filesystem/dentry.hpp @@ -8,6 +8,7 @@ #include #include +#include namespace filesystem { @@ -18,11 +19,14 @@ namespace filesystem dcache_mounted = 1 << 15 }; - dentry(kstd::shared_ptr const & parent, kstd::shared_ptr const & node); + dentry(kstd::shared_ptr const & parent, kstd::shared_ptr const & node, std::string_view name = {}); [[nodiscard]] auto get_inode() const -> kstd::shared_ptr const &; [[nodiscard]] auto get_parent() const -> kstd::shared_ptr const &; + auto add_child(kstd::shared_ptr const & child) -> void; + [[nodiscard]] auto find_child(std::string_view name) const -> kstd::shared_ptr; + auto set_flag(dentry_flags flag) -> void; auto unset_flag(dentry_flags flag) -> void; [[nodiscard]] auto has_flag(dentry_flags flag) const -> bool; diff --git a/kernel/include/kernel/filesystem/open_file_description.hpp b/kernel/include/kernel/filesystem/open_file_description.hpp index 3c97d50..e17f9fe 100644 --- a/kernel/include/kernel/filesystem/open_file_description.hpp +++ b/kernel/include/kernel/filesystem/open_file_description.hpp @@ -11,7 +11,7 @@ namespace filesystem { struct open_file_description { - open_file_description(kstd::shared_ptr const & inode); + explicit open_file_description(kstd::shared_ptr const & inode); ~open_file_description() = default; diff --git a/kernel/include/kernel/filesystem/vfs.hpp b/kernel/include/kernel/filesystem/vfs.hpp index b6d4c4c..317f2d1 100644 --- a/kernel/include/kernel/filesystem/vfs.hpp +++ b/kernel/include/kernel/filesystem/vfs.hpp @@ -39,7 +39,7 @@ namespace filesystem auto init_internal() -> void; auto make_device_node(kstd::shared_ptr const & device) -> void; - [[nodiscard]] auto resolve_path(std::string_view path) -> std::optional; + [[nodiscard]] auto resolve_path(std::string_view path) -> kstd::shared_ptr; kstd::shared_ptr m_root_fs; kstd::shared_ptr m_root_dentry; -- cgit v1.2.3