1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-30 07:15:06 +00:00
serenity/Kernel/FileSystem
Andreas Kling 248832f438 Kernel: Convert OpenFileDescriptor from mutex to spinlock
A mutex is useful when we need to be able to block the current thread
until it's available. This is overkill for OpenFileDescriptor.

First off, this patch wraps the main state member variables inside a
SpinlockProtected<State> to enforce synchronized access. This also
avoids "free locking" where figuring out which variables are guarded
by which lock is left as an unamusing exercise for the reader.

Then we remove mutex locking from the functions that simply call through
to the underlying File or Inode, since those fields never change anyway,
and the target objects perform their own synchronization.
2022-02-03 16:11:26 +01:00
..
AnonymousFile.cpp Kernel: Replace KResult and KResultOr<T> with Error and ErrorOr<T> 2021-11-08 01:10:53 +01:00
AnonymousFile.h Kernel: Use u64 instead of size_t for File::can_write offset 2022-01-25 22:41:17 +02:00
BlockBasedFileSystem.cpp Kernel: Use u64 instead of size_t for BlockBasedFileSystem::read_block 2022-01-25 22:41:17 +02:00
BlockBasedFileSystem.h Kernel: Use u64 instead of size_t for BlockBasedFileSystem::read_block 2022-01-25 22:41:17 +02:00
Custody.cpp Kernel: Remove the Custody::absolute_path() API 2022-01-12 16:09:09 +02:00
Custody.h Kernel: Remove the Custody::absolute_path() API 2022-01-12 16:09:09 +02:00
DeviceFileTypes.h Kernel: Include correct header for DistinctNumeric in DeviceFileTypes.h 2022-01-04 17:40:09 +00:00
DevPtsFS.cpp Kernel: Harden DevPtsFSInode::traverse_as_directory against OOM 2022-01-12 13:03:44 +01:00
DevPtsFS.h Everywhere: Pass AK::StringView by value 2021-11-11 01:27:46 +01:00
DevTmpFS.cpp Kernel: Make major and minor numbers to be DistinctNumerics 2021-12-23 23:02:39 +01:00
DevTmpFS.h Kernel: Make major and minor numbers to be DistinctNumerics 2021-12-23 23:02:39 +01:00
ext2_fs.h Everywhere: Fix spelling mistakes 2022-01-07 15:44:42 +01:00
ext2_types.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
Ext2FileSystem.cpp Kernel: Use HashCompatible HashMap lookups instead of specifying a hash 2022-01-29 23:01:23 +02:00
Ext2FileSystem.h Kernel: Use ErrorOr in BlockBased and Ext2 filesystem raw read and write 2022-01-23 14:36:01 +00:00
FIFO.cpp Kernel: Use u64 instead of size_t for File::can_write offset 2022-01-25 22:41:17 +02:00
FIFO.h Kernel: Use u64 instead of size_t for File::can_write offset 2022-01-25 22:41:17 +02:00
File.cpp Kernel: Port File to RefCounted 2021-12-29 12:04:15 +01:00
File.h Kernel: Use u64 instead of size_t for File::can_write offset 2022-01-25 22:41:17 +02:00
FileBackedFileSystem.cpp Kernel: Rename FileDescription => OpenFileDescription 2021-09-07 13:53:14 +02:00
FileBackedFileSystem.h Kernel: Rename FileDescription => OpenFileDescription 2021-09-07 13:53:14 +02:00
FileSystem.cpp Kernel: Use DistinctNumeric for filesystem ID's 2021-11-18 21:11:30 +01:00
FileSystem.h Kernel: Use DistinctNumeric for filesystem ID's 2021-11-18 21:11:30 +01:00
Inode.cpp Kernel: Make Inode::register_watcher() OOM-fallible 2022-01-26 02:37:03 +02:00
Inode.h Kernel: Make Inode::register_watcher() OOM-fallible 2022-01-26 02:37:03 +02:00
InodeFile.cpp Kernel+LibC: Move errno definitions to Kernel/API/POSIX 2021-12-16 22:21:35 +03:30
InodeFile.h Kernel: Use u64 instead of size_t for File::can_write offset 2022-01-25 22:41:17 +02:00
InodeIdentifier.h Kernel: Use DistinctNumeric for filesystem ID's 2021-11-18 21:11:30 +01:00
InodeMetadata.h Kernel: Make major and minor numbers to be DistinctNumerics 2021-12-23 23:02:39 +01:00
InodeWatcher.cpp Kernel: Make Inode::register_watcher() OOM-fallible 2022-01-26 02:37:03 +02:00
InodeWatcher.h Kernel: Use u64 instead of size_t for File::can_write offset 2022-01-25 22:41:17 +02:00
ISO9660FileSystem.cpp Kernel: Use ErrorOr in BlockBased and Ext2 filesystem raw read and write 2022-01-23 14:36:01 +00:00
ISO9660FileSystem.h Kernel: Remove empty ISO9660Inode::one_ref_left() 2022-01-11 01:12:16 +01:00
Mount.cpp Kernel: Convert Mount::absolute_path to ErrorOr<NonnullOwnPtr<KString>> 2022-01-12 16:09:09 +02:00
Mount.h Kernel: Convert Mount::absolute_path to ErrorOr<NonnullOwnPtr<KString>> 2022-01-12 16:09:09 +02:00
OpenFileDescription.cpp Kernel: Convert OpenFileDescriptor from mutex to spinlock 2022-02-03 16:11:26 +01:00
OpenFileDescription.h Kernel: Convert OpenFileDescriptor from mutex to spinlock 2022-02-03 16:11:26 +01:00
Plan9FileSystem.cpp Everywhere: Fix many spelling errors 2022-01-07 10:56:59 +01:00
Plan9FileSystem.h Everywhere: Pass AK::StringView by value 2021-11-11 01:27:46 +01:00
ProcFS.cpp Kernel+LibC: Move errno definitions to Kernel/API/POSIX 2021-12-16 22:21:35 +03:30
ProcFS.h Everywhere: Fix -Winconsistent-missing-override warnings from Clang 2021-12-11 13:14:15 -08:00
SysFS.cpp Kernel: Add implied auto-specifiers in FileSystem 2021-12-15 23:34:11 -08:00
SysFS.h Kernel/SysFS: Prevent allocation for component name during construction 2021-12-14 09:01:33 +01:00
SysFSComponent.cpp Kernel/SysFS: Prevent allocation for component name during construction 2021-12-14 09:01:33 +01:00
SysFSComponent.h Kernel/SysFS: Prevent allocation for component name during construction 2021-12-14 09:01:33 +01:00
TmpFS.cpp Kernel/TmpFS: Remove inode map from TmpFS 2022-01-14 12:15:36 +01:00
TmpFS.h Kernel/TmpFS: Remove inode map from TmpFS 2022-01-14 12:15:36 +01:00
UnveilNode.h Kernel: Move UnveilNode.h into Kernel/FileSystem/ 2021-08-06 14:11:45 +02:00
VirtualFileSystem.cpp AK: Standardize the behaviour of GenericLexer::consume_until overloads 2022-01-25 13:41:09 +03:30
VirtualFileSystem.h Kernel+LibC+LibCore+UE: Implement fchmodat(2) 2022-01-12 14:54:12 +01:00