mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-01 12:07:14 +02:00
Kernel/FileSystem: Simplify even more the mount syscall
As with the previous commit, we put a distinction between filesystems that require a file description and those which don't, but now in a much more readable mechanism - all initialization properties as well as the create static method are grouped to create the FileSystemInitializer structure. Then when we need to initialize an instance, we iterate over a table of these structures, checking for matching structure and then validating the given arguments from userspace against the requirements to ensure we can create a valid instance of the requested filesystem.
This commit is contained in:
Notes:
sideshowbarker
2024-07-17 10:35:38 +09:00
Author: https://github.com/supercomputer7 Commit: https://github.com/SerenityOS/serenity/commit/58acdce41f Pull-request: https://github.com/SerenityOS/serenity/pull/14123 Issue: https://github.com/SerenityOS/serenity/issues/11283 Reviewed-by: https://github.com/linusg
@@ -49,9 +49,9 @@ static u8 to_ext2_file_type(mode_t mode)
|
||||
return EXT2_FT_UNKNOWN;
|
||||
}
|
||||
|
||||
ErrorOr<NonnullRefPtr<Ext2FS>> Ext2FS::try_create(OpenFileDescription& file_description)
|
||||
ErrorOr<NonnullRefPtr<FileSystem>> Ext2FS::try_create(OpenFileDescription& file_description)
|
||||
{
|
||||
return adopt_nonnull_ref_or_enomem(new (nothrow) Ext2FS(file_description));
|
||||
return TRY(adopt_nonnull_ref_or_enomem(new (nothrow) Ext2FS(file_description)));
|
||||
}
|
||||
|
||||
Ext2FS::Ext2FS(OpenFileDescription& file_description)
|
||||
|
||||
Reference in New Issue
Block a user