diff options
Diffstat (limited to 'kernel/filesystem')
| -rw-r--r-- | kernel/filesystem/src/device_file.cpp | 1 | ||||
| -rw-r--r-- | kernel/filesystem/src/file_descriptor_table.cpp | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/kernel/filesystem/src/device_file.cpp b/kernel/filesystem/src/device_file.cpp index a6c234c..34195db 100644 --- a/kernel/filesystem/src/device_file.cpp +++ b/kernel/filesystem/src/device_file.cpp @@ -99,6 +99,7 @@ namespace filesystem return 0; size_t const total_to_process = std::min(size, capacity - offset); + // TODO BA-FS26 use kstd::vector when available std::array<std::byte, 512> scratch_buffer{}; // TODO BA-FS26 better solution than fixed scratch_buffer ?? auto processed = 0uz; diff --git a/kernel/filesystem/src/file_descriptor_table.cpp b/kernel/filesystem/src/file_descriptor_table.cpp index 0c79431..645da9f 100644 --- a/kernel/filesystem/src/file_descriptor_table.cpp +++ b/kernel/filesystem/src/file_descriptor_table.cpp @@ -49,11 +49,13 @@ namespace filesystem auto file_descriptor_table::get_file(int fd) -> open_file_description & { + // TODO BA-FS26 do not panic, its an user error if (fd < 0) { kapi::system::panic("[FILESYSTEM] get_file called with negative descriptor."); } + // TODO BA-FS26 do not panic, its an user error auto const index = static_cast<size_t>(fd); if (index >= m_open_files.size() || m_open_files[index] == nullptr) { @@ -65,17 +67,21 @@ namespace filesystem auto file_descriptor_table::remove_file(int fd) -> void { + // TODO BA-FS26 do not panic, its an user error if (fd < 0) { kapi::system::panic("[FILESYSTEM] remove_file called with negative descriptor."); } + // TODO BA-FS26 do not panic, its an user error auto const index = static_cast<size_t>(fd); if (index >= m_open_files.size()) { kapi::system::panic("[FILESYSTEM] remove_file called with out-of-range descriptor."); } + // TODO BA-FS26 + // delete m_open_files[index]; m_open_files[index] = nullptr; } } // namespace filesystem
\ No newline at end of file |
