mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 21:57:35 +00:00
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:
parent
63fc36d00d
commit
23a7ccf607
39 changed files with 651 additions and 214 deletions
|
@ -117,6 +117,9 @@ int fchown(int fd, uid_t, gid_t);
|
|||
int fchownat(int fd, char const* pathname, uid_t uid, gid_t gid, int flags);
|
||||
int ftruncate(int fd, off_t length);
|
||||
int truncate(char const* path, off_t length);
|
||||
int fsopen(char const* fs_type, int flags);
|
||||
int fsmount(int mount_fd, int source_fd, char const* target);
|
||||
int bindmount(int source_fd, char const* target, int flags);
|
||||
int mount(int source_fd, char const* target, char const* fs_type, int flags);
|
||||
int umount(char const* mountpoint);
|
||||
int pledge(char const* promises, char const* execpromises);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue