3 Commits
Author SHA1 Message Date
Lucas Chollet d87eb4ab2a Kernel/FileSystem: Use 64-bits types in FileSystemSpecificOption
The rest of the plumbing already used 64-bits types, making
FileSystemSpecificOption silently truncate the arguments.

With this patch, we can now create RAMFS filesystems with a size above
4 GiB.
2026-10-30 16:19:42 +01:00
Lucas Chollet b17001d847 Kernel/FileSystem: Share more code in option parsing functions 2026-10-30 16:19:42 +01:00
Liav A. cb10f70394 Kernel: Change internal handling of filesystem-specific options
Instead of using a raw `KBuffer` and letting each implementation to
populating the specific flags on its own, we change things so we only
let each FileSystem implementation to validate the flag and its value
but then store it in a HashMap which its key is the flag name and
the value is a special new class called `FileSystemSpecificOption`
which wraps around `AK::Variant<...>`.

This approach has multiple advantages over the previous:
- It allows runtime inspection of what the user has set on a `MountFile`
  description for a specific filesystem.
- It ensures accidental overriding of filesystem specific option that
  was already set is not possible
- It removes ugly casting of a `KBuffer` contents to a strongly-typed
  values. Instead, a strongly-typed `AK::Variant` is used which ensures
  we always get a value without doing any casting.

Please note that we have removed support for ASCII string-oriented flags
as there were no actual use cases, and supporting such type would make
`FileSystemSpecificOption` more complicated unnecessarily for now.
2024-08-03 20:35:06 +02:00