summaryrefslogtreecommitdiff
path: root/Kernel/FileSystem
AgeCommit message (Collapse)Author
2021-09-07Kernel: Store process names as KStringAndreas Kling
2021-09-07Kernel: Make UserOrKernelBuffer return KResult from read/write/memsetAndreas Kling
This allows us to simplify a whole bunch of call sites with TRY(). :^)
2021-09-06Kernel: Wrap two VirtualFileSystem directory traversals in TRY()Andreas Kling
2021-09-06Kernel: Wrap ISO9660FS directory traversal in TRY()Andreas Kling
2021-09-06Kernel: Use TRY() in TmpFSInode::write_bytes()Andreas Kling
2021-09-06Kernel: Make KString factories return KResultOr + use TRY() everywhereAndreas Kling
There are a number of places that don't have an error propagation path right now, so I've added FIXME's about that.
2021-09-06Kernel: Make KBufferBuilder::append() & friends return KResultAndreas Kling
This allows callers to react to a failed append (due to OOM.)
2021-09-06Kernel: Use KResultOr and TRY() for {Shared,Private}InodeVMObjectAndreas Kling
2021-09-06Kernel: Improvements to Custody absolute path serializationAndreas Kling
- Renamed try_create_absolute_path() => try_serialize_absolute_path() - Use KResultOr and TRY() to propagate errors - Don't call this when it's only for debug logging
2021-09-06Kernel/Ext2FS: Wrap calls to traverse_as_directory() in TRY()Andreas Kling
Nothing says we can't TRY() a multi-line function call. :^)
2021-09-06Kernel: Use TRY() more in Plan9FSAndreas Kling
2021-09-06Kernel: Tidy up Plan9FS construction a bitAndreas Kling
2021-09-06Kernel: Tidy up Ext2FS construction a bitAndreas Kling
2021-09-06Kernel: Tidy up SysFS constructionAndreas Kling
- Use KResultOr and TRY() to propagate errors - Check for OOM errors - Move allocation out of constructors There's still a lot more to do here, as SysFS is still quite brittle in the face of memory pressure.
2021-09-06Kernel: Tidy up DevFS construction and handle OOM errorsoAndreas Kling
- Use KResultOr and TRY() to propagate errors - Check for OOM - Move allocations out of the DevFS constructor
2021-09-06Kernel: Tidy up DevPtsFS construction and handle OOM errorsAndreas Kling
- Use KResultOr and TRY() to propagate errors - Check for OOM when creating new inodes
2021-09-06Kernel: Tidy up TmpFS and TmpFSInode constructionAndreas Kling
- Use KResultOr<NonnullRefPtr<T>> - Propagate errors - Use TRY() at call sites
2021-09-06Kernel: Use TRY() in ISO9660FileSystemAndreas Kling
2021-09-06Kernel: Simplify WatchDescription::create()Andreas Kling
2021-09-06Kernel: Use TRY() some more in FileDescriptionAndreas Kling
2021-09-06Kernel: Use TRY() in BlockBasedFileSystemAndreas Kling
2021-09-06Everywhere: Make ByteBuffer::{create_*,copy}() OOM-safeAli Mohammad Pur
2021-09-05Kernel: Make all Spinlocks use u8 for storage, remove templateBrian Gianforcaro
The default template argument is only used in one place, and it looks like it was probably just an oversight. The rest of the Kernel code all uses u8 as the type. So lets make that the default and remove the unused template argument, as there doesn't seem to be a reason to allow the size to be customizable.
2021-09-05Kernel: Use TRY() in DevFSLinkInode::write_bytes()Andreas Kling
2021-09-05Kernel: Use TRY() in ProcFSAndreas Kling
2021-09-05Kernel: Make FileSystem::get_inode() return KResultOr<NRP<Inode>>Andreas Kling
This allows for natural error propagation in a bunch of new places.
2021-09-05Kernel: Make copy_{from,to}_user() return KResult and use TRY()Andreas Kling
This makes EFAULT propagation flow much more naturally. :^)
2021-09-05Kernel: Use TRY() in FileDescription::attach()Andreas Kling
2021-09-05Kernel: Use TRY() in InodeAndreas Kling
2021-09-05Kernel: Use TRY() in FIFOAndreas Kling
2021-09-05Kernel: Use TRY() in InodeFileAndreas Kling
2021-09-05Kernel/Ext2FS: Use TRY() in the Ext2FSAndreas Kling
This class was just *full* of great opportunities for TRY(). :^)
2021-09-05Kernel: Use TRY() even more in VirtualFileSystemAndreas Kling
Allowing TRY() with KResult unlocked a whole lot more opportunities.
2021-09-05Kernel: Tidy up VirtualFileSystem::mount_root() a little bitAndreas Kling
- Return KResult instead of bool - Use TRY()
2021-09-05Kernel: Use TRY() in FileDescriptionAndreas Kling
2021-09-05Kernel: Tidy up AnonymousFile construction a bitAndreas Kling
- Rename create() => try_create() - Use adopt_nonnull_ref_or_enomem()
2021-09-05Kernel: Use TRY() in VirtualFileSystemAndreas Kling
2021-09-05AK+Kernel: Move KResult.h to Kernel/API for userspace accesssin-ack
This commit moves the KResult and KResultOr objects to Kernel/API to signify that they may now be freely used by userspace code at points where a syscall-related error result is to be expected. It also exposes KResult and KResultOr to the global namespace to make it nicer to use for userspace code.
2021-09-05Kernel: Rename FileBlocker::unblock() => unblock_if_conditions_are_met()Andreas Kling
Since this may not actually unblock, the old name was very confusing.
2021-09-05Kernel: Tidy up InodeWatcher constructionAndreas Kling
- Rename create() => try_create() - Use adopt_nonnull_ref_or_enomem()
2021-09-05Kernel/Plan9FS: Use KString instead of String in one placeAndreas Kling
2021-09-05Kernel/Ext2FS: Remove a String allocation in debug loggingAndreas Kling
We were creating a temporary String just to log the target when writing a symlink directly into inline storage.
2021-09-04Kernel/SysFS: Ensure data stability when reading from InodesLiav A
Like with the ProcFS, description data can change at anytime, so it's wise to ensure that when the userland reads from an Inode, data is consistent unless the userland indicated it wants to refresh the data (by seeking to offset 0, or re-attaching the Inode). Otherwise, if the data changes in the middle of the reading, it can cause silent corruption in output which can lead to random crashes.
2021-09-04Kernel/DevFS: Remove unnecessary includeLiav A
2021-09-03Everywhere: Prevent risky implicit casts of (Nonnull)RefPtrDaniel Bertalan
Our existing implementation did not check the element type of the other pointer in the constructors and move assignment operators. This meant that some operations that would require explicit casting on raw pointers were done implicitly, such as: - downcasting a base class to a derived class (e.g. `Kernel::Inode` => `Kernel::ProcFSDirectoryInode` in Kernel/ProcFS.cpp), - casting to an unrelated type (e.g. `Promise<bool>` => `Promise<Empty>` in LibIMAP/Client.cpp) This, of course, allows gross violations of the type system, and makes the need to type-check less obvious before downcasting. Luckily, while adding the `static_ptr_cast`s, only two truly incorrect usages were found; in the other instances, our casts just needed to be made explicit.
2021-09-01Kernel: Convert UserOrKernelBuffer callbacks to use AK::BytesBrian Gianforcaro
2021-09-01Kernel: Pass InodeMetadata by reference in TmpFSInode::createBrian Gianforcaro
This struct is non-trivially large, it makes sense to pass it by reference instead of by value in the factory method. Found by Sonar Cloud.
2021-08-29Kernel/SysFS: Remove unnecessary mutex lockers in SysFS metadata gettersAndreas Kling
SysFS inodes have immutable metadata once created.
2021-08-29Kernel: Make all ProcFS and SysFS files zero-sizedAndreas Kling
There is no value in exposing particular sizes for these files.
2021-08-29Kernel: Remove an obviously redundant check in FIFO::read()Andreas Kling