mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-03 13:00:29 +00: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.
30 lines
637 B
C
30 lines
637 B
C
/*
|
|
* Copyright (c) 2022-2023, Liav A. <liavalb@hotmail.co.il>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/Types.h>
|
|
|
|
#define MOUNT_SPECIFIC_FLAG_KEY_STRING_MAX_LENGTH 64
|
|
|
|
#define MOUNT_SPECIFIC_FLAG_NON_ASCII_STRING_TYPE_MAX_LENGTH 64
|
|
#define MOUNT_SPECIFIC_FLAG_ASCII_STRING_TYPE_MAX_LENGTH 1024
|
|
|
|
struct MountSpecificFlag {
|
|
u32 key_string_length;
|
|
u32 value_length;
|
|
|
|
enum class ValueType : u32 {
|
|
Boolean = 0,
|
|
UnsignedInteger,
|
|
SignedInteger,
|
|
ASCIIString,
|
|
};
|
|
|
|
ValueType value_type;
|
|
unsigned char const* key_string_addr;
|
|
void const* value_addr;
|
|
};
|