diff options
| author | Lukas Oesch <lukasoesch20@gmail.com> | 2026-04-19 10:01:52 +0200 |
|---|---|---|
| committer | Lukas Oesch <lukasoesch20@gmail.com> | 2026-04-19 10:01:52 +0200 |
| commit | 1356405c9fc6d54cf9da4d5f6fd54c55d51ce66d (patch) | |
| tree | 8204fad4c5882f7a371410086b12298f88c73a8f /kernel/kapi | |
| parent | e9837b17eeee5ba69f5067e5bfe3f40aca0a9277 (diff) | |
| download | teachos-1356405c9fc6d54cf9da4d5f6fd54c55d51ce66d.tar.xz teachos-1356405c9fc6d54cf9da4d5f6fd54c55d51ce66d.zip | |
vfs open returns the dentry not the open file description
Diffstat (limited to 'kernel/kapi')
| -rw-r--r-- | kernel/kapi/filesystem.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/kernel/kapi/filesystem.cpp b/kernel/kapi/filesystem.cpp index 30201b7..d3aa617 100644 --- a/kernel/kapi/filesystem.cpp +++ b/kernel/kapi/filesystem.cpp @@ -1,8 +1,11 @@ #include "kapi/filesystem.hpp" #include "kernel/filesystem/file_descriptor_table.hpp" +#include "kernel/filesystem/open_file_description.hpp" #include "kernel/filesystem/vfs.hpp" +#include <kstd/memory> + #include <cstddef> #include <string_view> #include <sys/types.h> @@ -29,8 +32,9 @@ namespace kapi::filesystem auto open(std::string_view path) -> int { - if (auto open_file_description = kernel::filesystem::vfs::get().open(path)) + if (auto dentry = kernel::filesystem::vfs::get().open(path)) { + auto open_file_description = kstd::make_shared<kernel::filesystem::open_file_description>(dentry->get_inode()); return kernel::filesystem::file_descriptor_table::get().add_file(open_file_description); } |
