ladybird/Kernel/FileSystem
Tom 75f61fe3d9 AK: Make RefPtr, NonnullRefPtr, WeakPtr thread safe
This makes most operations thread safe, especially so that they
can safely be used in the Kernel. This includes obtaining a strong
reference from a weak reference, which now requires an explicit
call to WeakPtr::strong_ref(). Another major change is that
Weakable::make_weak_ref() may require the explicit target type.
Previously we used reinterpret_cast in WeakPtr, assuming that it
can be properly converted. But WeakPtr does not necessarily have
the knowledge to be able to do this. Instead, we now ask the class
itself to deliver a WeakPtr to the type that we want.

Also, WeakLink is no longer specific to a target type. The reason
for this is that we want to be able to safely convert e.g. WeakPtr<T>
to WeakPtr<U>, and before this we just reinterpret_cast the internal
WeakLink<T> to WeakLink<U>, which is a bold assumption that it would
actually produce the correct code. Instead, WeakLink now operates
on just a raw pointer and we only make those constructors/operators
available if we can verify that it can be safely cast.

In order to guarantee thread safety, we now use the least significant
bit in the pointer for locking purposes. This also means that only
properly aligned pointers can be used.
2020-11-10 19:11:52 +01:00
..
BlockBasedFileSystem.cpp Kernel: Make copy_to/from_user safe and remove unnecessary checks 2020-09-13 21:19:15 +02:00
BlockBasedFileSystem.h Kernel: Make copy_to/from_user safe and remove unnecessary checks 2020-09-13 21:19:15 +02:00
Custody.cpp Kernel: Support read-only filesystem mounts 2020-05-29 07:53:30 +02:00
Custody.h Kernel: Support read-only filesystem mounts 2020-05-29 07:53:30 +02:00
DevPtsFS.cpp AK: Make RefPtr, NonnullRefPtr, WeakPtr thread safe 2020-11-10 19:11:52 +01:00
DevPtsFS.h Kernel: Make copy_to/from_user safe and remove unnecessary checks 2020-09-13 21:19:15 +02:00
ext2_fs.h Meta: Remove some copyright headers added in error 2020-01-25 10:34:32 +01:00
ext2_types.h Meta: Add a script check the presence of "#pragma once" in header files 2020-05-29 07:59:45 +02:00
Ext2FileSystem.cpp Ext2FS: Zero out inode metadata when deleting them 2020-11-07 17:48:22 +01:00
Ext2FileSystem.h Ext2FS: Deallocate block list meta blocks when freeing an inode 2020-11-07 16:45:03 +01:00
FIFO.cpp Kernel: Make copy_to/from_user safe and remove unnecessary checks 2020-09-13 21:19:15 +02:00
FIFO.h Kernel: Make copy_to/from_user safe and remove unnecessary checks 2020-09-13 21:19:15 +02:00
File.cpp Kernel: Allow File::close() to fail 2020-06-02 21:49:47 +02:00
File.h Kernel: Make copy_to/from_user safe and remove unnecessary checks 2020-09-13 21:19:15 +02:00
FileBackedFileSystem.cpp Kernel: Split BlockBasedFileSystem off FileBackedFileSystem 2020-07-05 12:26:27 +02:00
FileBackedFileSystem.h Kernel: Split BlockBasedFileSystem off FileBackedFileSystem 2020-07-05 12:26:27 +02:00
FileDescription.cpp Kernel: Fix kernel crash in get_dir_entries when buffer too small. 2020-09-16 17:10:04 +02:00
FileDescription.h Kernel: Make copy_to/from_user safe and remove unnecessary checks 2020-09-13 21:19:15 +02:00
FileSystem.cpp Kernel: Switch singletons to use new Singleton class 2020-08-25 09:48:48 +02:00
FileSystem.h Meta+Kernel: Make clang-format-10 clean 2020-09-25 21:18:17 +02:00
Inode.cpp AK: Make RefPtr, NonnullRefPtr, WeakPtr thread safe 2020-11-10 19:11:52 +01:00
Inode.h AK: Make RefPtr, NonnullRefPtr, WeakPtr thread safe 2020-11-10 19:11:52 +01:00
InodeFile.cpp Kernel: Make copy_to/from_user safe and remove unnecessary checks 2020-09-13 21:19:15 +02:00
InodeFile.h Kernel: Make copy_to/from_user safe and remove unnecessary checks 2020-09-13 21:19:15 +02:00
InodeIdentifier.h Meta+Kernel: Make clang-format-10 clean 2020-09-25 21:18:17 +02:00
InodeMetadata.h Everywhere: Redundant inline specifier on constexpr functions (#3807) 2020-10-20 18:08:13 +02:00
InodeWatcher.cpp AK: Make RefPtr, NonnullRefPtr, WeakPtr thread safe 2020-11-10 19:11:52 +01:00
InodeWatcher.h Kernel: Let InodeWatcher track child inode numbers instead of names 2020-09-19 16:39:52 +02:00
Plan9FileSystem.cpp Kernel: Make copy_to/from_user safe and remove unnecessary checks 2020-09-13 21:19:15 +02:00
Plan9FileSystem.h Kernel: Make copy_to/from_user safe and remove unnecessary checks 2020-09-13 21:19:15 +02:00
ProcFS.cpp Meta+Kernel: Make clang-format-10 clean 2020-09-25 21:18:17 +02:00
ProcFS.h Meta+Kernel: Make clang-format-10 clean 2020-09-25 21:18:17 +02:00
TmpFS.cpp TmpFS: Don't allow file names longer than NAME_MAX 2020-10-22 18:59:00 +02:00
TmpFS.h Kernel: Make copy_to/from_user safe and remove unnecessary checks 2020-09-13 21:19:15 +02:00
VirtualFileSystem.cpp Kernel+LibC: Don't allow a directory to become a subdirectory of itself 2020-11-01 19:21:19 +01:00
VirtualFileSystem.h Kernel: Fix various forward declarations 2020-09-12 13:46:15 +02:00