Kernel+LibCore+LibC: Split the mount syscall into multiple syscalls

This is a preparation before we can create a usable mechanism to use
filesystem-specific mount flags.
To keep some compatibility with userland code, LibC and LibCore mount
functions are kept being usable, but now instead of doing an "atomic"
syscall, they do multiple syscalls to perform the complete procedure of
mounting a filesystem.

The FileBackedFileSystem IntrusiveList in the VFS code is now changed to
be protected by a Mutex, because when we mount a new filesystem, we need
to check if a filesystem is already created for a given source_fd so we
do a scan for that OpenFileDescription in that list. If we fail to find
an already-created filesystem we create a new one and register it in the
list if we successfully mounted it. We use a Mutex because we might need
to initiate disk access during the filesystem creation, which will take
other mutexes in other parts of the kernel, therefore making it not
possible to take a spinlock while doing this.
This commit is contained in:
Liav A 2022-12-15 11:42:40 +02:00 committed by Jelle Raaijmakers
parent 63fc36d00d
commit 23a7ccf607
Notes: sideshowbarker 2024-07-17 17:49:11 +09:00
39 changed files with 651 additions and 214 deletions

View file

@ -10,7 +10,7 @@
namespace Kernel {
ErrorOr<NonnullRefPtr<FileSystem>> RAMFS::try_create()
ErrorOr<NonnullRefPtr<FileSystem>> RAMFS::try_create(ReadonlyBytes)
{
return TRY(adopt_nonnull_ref_or_enomem(new (nothrow) RAMFS));
}