From f2b46c2d9cd9b1bf4b5ec5f35593ae60b3740d0c Mon Sep 17 00:00:00 2001 From: Marcel Braun Date: Thu, 14 May 2026 17:24:49 +0200 Subject: Document design rationale for resolve_path return type --- kernel/include/kernel/filesystem/vfs.hpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'kernel') diff --git a/kernel/include/kernel/filesystem/vfs.hpp b/kernel/include/kernel/filesystem/vfs.hpp index 2aa1dd7..7a6ebf9 100644 --- a/kernel/include/kernel/filesystem/vfs.hpp +++ b/kernel/include/kernel/filesystem/vfs.hpp @@ -79,6 +79,16 @@ namespace kernel::filesystem vfs() = default; auto init_internal() -> void; + /** + * Note: Resolving a dentry requires traversing mount points; since the + * associated 'mount' object is discovered as a byproduct of this + * traversal, we return it alongside the dentry to avoid redundant + * lookups in callers that require mount context. + * + * If only one component is needed, the convenience wrappers can be used: + * - resolve_path() for the dentry only. + * - find_mount() for the mount context only. + */ [[nodiscard]] auto resolve_path_internal(std::string_view path) -> std::pair, kstd::shared_ptr>; [[nodiscard]] auto resolve_path(std::string_view path) -> kstd::shared_ptr; -- cgit v1.2.3