1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:48:11 +00:00

Ext2FS: Make reported file_type values match up with those in dirent

This fixes an issue we had in the git port where git would not
recognize untracked files (for example in 'git status').
When git used readdir, the 'd_type' field in the dirent struct contained
bad values (Specifically, it contained the values defiend in
Kernel/FileSystem/ext2_fs.h instead of the ones in LibC/dirent.h).

After this fix, we can create a new git repository with 'git init', and
then stage and commit files as usual.
This commit is contained in:
Itamar 2020-08-28 16:15:51 +03:00 committed by Andreas Kling
parent 6cf064e4c6
commit b6c34c0521
3 changed files with 47 additions and 1 deletions

View file

@ -81,6 +81,8 @@ private:
void populate_lookup_cache() const;
KResult resize(u64);
static u8 file_type_for_directory_entry(const ext2_dir_entry_2&);
Ext2FS& fs();
const Ext2FS& fs() const;
Ext2FSInode(Ext2FS&, unsigned index);