mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-10 18:10:56 +09:00
FileSystem: Convert file types to DT_* types at a later stage
A change introduced in 5e01234 made it the resposibility of each filesystem to have the file types returned from 'traverse_as_directory' match up with the DT_* types. However, this caused corruption of the Ext2FS file format because the Ext2FS uses 'traverse_as_directory' internally when manipulating the file system. The result was a mixture between EXT2_FT_* and DT_* file types in the internal Ext2FS structures. Starting with this commit, the conversion from internal filesystem file types to the user facing DT_* types happens at a later stage, in the 'FileDescription::get_dir_entries' function which is directly used by sys$get_dir_entries.
This commit is contained in:
parent
e68b158a52
commit
33138900de
Notes:
sideshowbarker
2024-07-19 03:02:47 +09:00
Author: https://github.com/itamar8910
Commit: 33138900de
Pull-request: https://github.com/SerenityOS/serenity/pull/3348
4 changed files with 11 additions and 6 deletions
|
@ -188,9 +188,9 @@ ssize_t FileDescription::get_dir_entries(u8* buffer, ssize_t size)
|
|||
|
||||
auto temp_buffer = ByteBuffer::create_uninitialized(size_to_allocate);
|
||||
BufferStream stream(temp_buffer);
|
||||
KResult result = VFS::the().traverse_directory_inode(*m_inode, [&stream](auto& entry) {
|
||||
KResult result = VFS::the().traverse_directory_inode(*m_inode, [&stream, this](auto& entry) {
|
||||
stream << (u32)entry.inode.index();
|
||||
stream << (u8)entry.file_type;
|
||||
stream << m_inode->fs().internal_file_type_to_directory_entry_type(entry);
|
||||
stream << (u32)entry.name.length();
|
||||
stream << entry.name;
|
||||
return true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue