mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03:00
23a7ccf607
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.
103 lines
1.9 KiB
C++
103 lines
1.9 KiB
C++
/*
|
|
* Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/DistinctNumeric.h>
|
|
#include <Kernel/API/POSIX/sys/types.h>
|
|
|
|
namespace Kernel {
|
|
|
|
enum class LockRank;
|
|
|
|
class BlockDevice;
|
|
class CharacterDevice;
|
|
class Coredump;
|
|
class Credentials;
|
|
class Custody;
|
|
class Device;
|
|
class DiskCache;
|
|
class DoubleBuffer;
|
|
class File;
|
|
class FATInode;
|
|
class OpenFileDescription;
|
|
class DisplayConnector;
|
|
class FileSystem;
|
|
class FutexQueue;
|
|
class IPv4Socket;
|
|
class Inode;
|
|
class InodeIdentifier;
|
|
class InodeWatcher;
|
|
class MountFile;
|
|
class Jail;
|
|
class KBuffer;
|
|
class KString;
|
|
class LocalSocket;
|
|
class Mutex;
|
|
class MasterPTY;
|
|
class Mount;
|
|
class PerformanceEventBuffer;
|
|
class ProcFS;
|
|
class ProcFSInode;
|
|
class Process;
|
|
class ProcessGroup;
|
|
class RAMFS;
|
|
template<LockRank Rank>
|
|
class RecursiveSpinlock;
|
|
class Scheduler;
|
|
class Socket;
|
|
class SysFS;
|
|
class SysFSDirectory;
|
|
class SysFSRootDirectory;
|
|
class SysFSBusDirectory;
|
|
class SysFSDevicesDirectory;
|
|
class SysFSDirectoryInode;
|
|
class SysFSInode;
|
|
class TCPSocket;
|
|
class TTY;
|
|
class Thread;
|
|
class ThreadTracer;
|
|
class RAMFSInode;
|
|
class UDPSocket;
|
|
class UserOrKernelBuffer;
|
|
class VirtualFileSystem;
|
|
class WaitQueue;
|
|
class WorkQueue;
|
|
|
|
namespace Memory {
|
|
class AddressSpace;
|
|
class AnonymousVMObject;
|
|
class InodeVMObject;
|
|
class MappedROM;
|
|
class MemoryManager;
|
|
class PageDirectory;
|
|
class PhysicalPage;
|
|
class PhysicalRegion;
|
|
class PrivateInodeVMObject;
|
|
class Region;
|
|
class SharedInodeVMObject;
|
|
class VMObject;
|
|
class VirtualRange;
|
|
}
|
|
|
|
template<LockRank Rank>
|
|
class Spinlock;
|
|
template<typename LockType>
|
|
class SpinlockLocker;
|
|
|
|
struct InodeMetadata;
|
|
struct TrapFrame;
|
|
|
|
AK_TYPEDEF_DISTINCT_ORDERED_ID(pid_t, ProcessID);
|
|
AK_TYPEDEF_DISTINCT_ORDERED_ID(pid_t, ThreadID);
|
|
AK_TYPEDEF_DISTINCT_ORDERED_ID(pid_t, SessionID);
|
|
AK_TYPEDEF_DISTINCT_ORDERED_ID(pid_t, ProcessGroupID);
|
|
|
|
AK_TYPEDEF_DISTINCT_ORDERED_ID(uid_t, UserID);
|
|
AK_TYPEDEF_DISTINCT_ORDERED_ID(gid_t, GroupID);
|
|
|
|
}
|