1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2026-01-14 20:11:00 +00:00
serenity/Kernel/FileSystem
Liav A a10e63f08e Kernel/FileSystem: Send proper filetypes when traversing RAM-backed FSes
SysFS, ProcFS and DevPtsFS were all sending filetype 0 when traversing
their directories, but it is actually very easy to send proper filetypes
in these filesystems.
This patch binds all RAM backed filesystems to use only one enum for
their internal filetype, to simplify the implementation and allow
sharing of code.
Please note that the Plan9FS case is currently not solved as I am not
familiar with this filesystem and its constructs.

The ProcFS mostly keeps track of the filetype, and a fix was needed for
the /proc root directory - all processes exhibit a directory inside it
which makes it very easy to hardcode the directory filetype for them.
There's also the `self` symlink inode which is now exposed as DT_LNK.

As for SysFS, we could leverage the fact everything inherits from the
SysFSComponent class, so we could have a virtual const method to return
the proper filetype.
Most of the files in SysFS are "regular" files though, so the base class
has a non-pure virtual method.

Lastly, the DevPtsFS simply hardcodes '.' and '..' as directory file
type, and everything else is hardcoded to send the character device file
type, as this filesystem is only exposing character pts device files.
2024-01-13 19:01:07 -07:00
..
DevPtsFS Kernel/FileSystem: Send proper filetypes when traversing RAM-backed FSes 2024-01-13 19:01:07 -07:00
Ext2FS Kernel/Ext2: Only handle extended attributes when they are supported 2024-01-05 04:00:11 +03:30
FATFS Kernel/FileSystem/FATFS: Use AssertSize to enforce FAT structure sizes 2024-01-12 15:54:46 -07:00
ISO9660FS Kernel/FileSystem: Rename block_size -> logical_block_size 2023-07-28 14:51:07 +02:00
Plan9FS Kernel: Don't allocate memory for names of processes and threads 2023-08-09 21:06:54 -06:00
ProcFS Kernel/FileSystem: Send proper filetypes when traversing RAM-backed FSes 2024-01-13 19:01:07 -07:00
RAMFS Kernel/FileSystem: Send proper filetypes when traversing RAM-backed FSes 2024-01-13 19:01:07 -07:00
SysFS Kernel/FileSystem: Send proper filetypes when traversing RAM-backed FSes 2024-01-13 19:01:07 -07:00
AnonymousFile.cpp
AnonymousFile.h
BlockBasedFileSystem.cpp Kernel: Allow Ext2FS::flush_writes() to return ErrorOr<void> 2023-08-25 11:36:57 +01:00
BlockBasedFileSystem.h Kernel: Allow Ext2FS::flush_writes() to return ErrorOr<void> 2023-08-25 11:36:57 +01:00
Custody.cpp
Custody.h
FIFO.cpp
FIFO.h
File.cpp
File.h
FileBackedFileSystem.cpp
FileBackedFileSystem.h
FileSystem.cpp Kernel/Ext2: Check and set file system state 2023-07-15 00:12:01 +02:00
FileSystem.h AK: Rename GenericTraits to DefaultTraits 2023-11-09 10:05:51 -05:00
Initializer.h
Inode.cpp Kernel/FS: Fix check-then-act concurrency bug in FileSystem/Inode 2023-11-20 09:44:29 +01:00
Inode.h
InodeFile.cpp
InodeFile.h
InodeIdentifier.h
InodeMetadata.cpp
InodeMetadata.h Kernel: Populate stat.st_dev with fsid 2023-10-01 13:34:41 +02:00
InodeWatcher.cpp
InodeWatcher.h
Mount.cpp
Mount.h
MountFile.cpp Kernel: Use FixedStringBuffer for fixed-length strings in syscalls 2023-08-09 21:06:54 -06:00
MountFile.h
OpenFileDescription.cpp Kernel: Move TTY-related code to a new subdirectory under Devices 2023-09-09 12:08:59 -06:00
OpenFileDescription.h
RAMBackedFileType.h Kernel/FileSystem: Send proper filetypes when traversing RAM-backed FSes 2024-01-13 19:01:07 -07:00
UnveilNode.h
VirtualFileSystem.cpp Kernel: Run clang-format on a couple of FileSystem sources 2023-08-25 08:34:21 -04:00
VirtualFileSystem.h Kernel/VFS: Ensure working with mount entry per a custody is safe 2023-08-05 18:41:01 +02:00