diff options
| author | Marcel Braun <marcel.braun@ost.ch> | 2026-05-14 17:24:49 +0200 |
|---|---|---|
| committer | Lukas Oesch <lukasoesch20@gmail.com> | 2026-05-16 11:56:07 +0200 |
| commit | f2b46c2d9cd9b1bf4b5ec5f35593ae60b3740d0c (patch) | |
| tree | 12c9ecf33622b53c33c3749996c583d65d94daec /kernel/include | |
| parent | 216ec44cf2fdc914ce38e3ab56eb3a8d82b54c77 (diff) | |
| download | kernel-f2b46c2d9cd9b1bf4b5ec5f35593ae60b3740d0c.tar.xz kernel-f2b46c2d9cd9b1bf4b5ec5f35593ae60b3740d0c.zip | |
Document design rationale for resolve_path return type
Diffstat (limited to 'kernel/include')
| -rw-r--r-- | kernel/include/kernel/filesystem/vfs.hpp | 10 |
1 files changed, 10 insertions, 0 deletions
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<dentry>, kstd::shared_ptr<mount>>; [[nodiscard]] auto resolve_path(std::string_view path) -> kstd::shared_ptr<dentry>; |
