summaryrefslogtreecommitdiff
path: root/Kernel/FileSystem
AgeCommit message (Collapse)Author
2021-09-12Kernel/SysFS: Make it possible to have custom permissions for nodesLiav A
2021-09-12Kernel+LibC: Implement fsyncTheFightingCatfish
2021-09-11Kernel/Devices: Defer creation of SysFS component after the constructorLiav A
Instead of doing so in the constructor, let's do immediately after the constructor, so we can safely pass a reference of a Device, so the SysFSDeviceComponent constructor can use that object to identify whether it's a block device or a character device. This allows to us to not hold a device in SysFSDeviceComponent with a RefPtr. Also, we also call the before_removing method in both SlavePTY::unref and File::unref, so because Device has that method being overrided, it can ensure the device is removed always cleanly.
2021-09-10AK+Everywhere: Reduce the number of template parameters of IntrusiveListAli Mohammad Pur
This makes the user-facing type only take the node member pointer, and lets the compiler figure out the other needed types from that.
2021-09-09Kernel/VFS: Restrict special unveil rule for Loader.soRalf Donau
2021-09-08Kernel: Add KBuffer::bytes() and use itAndreas Kling
(Instead of hand-wrapping { data(), size() } in a bunch of places.)
2021-09-08Kernel+SystemServer: Simplify the DevTmpFS designLiav A
We are no longer have a separate Inode object class for the pts directory. With a small exception to this, all chmod and chown code is now at one place. It's now possible to create any name of a sub-directory in the filesystem.
2021-09-08Kernel: Rename DevFS => DevTmpFSLiav A
The current implementation of DevFS resembles the linux devtmpfs, and not the traditional DevFS, so let's rename it to better represent the direction of the development in regard to this filesystem. The abbreviation for DevTmpFS is still "dev", because it doesn't add value as a commandline option to make it longer. In quick summary - DevFS in unix OSes is simply a static filesystem, so device nodes are generated and removed by the kernel code. DevTmpFS is a "modern reinvention" of the DevFS, so it is much more like a TmpFS in the sense that not only it's stored entirely in RAM, but the userland is responsible to add and remove devices nodes as it sees fit, and no kernel code is directly being involved to keep the filesystem in sync.
2021-09-08Kernel/DevFS: Add the ability to remove device nodesLiav A
In order to make this kind of operation simpler, we no longer use a Vector to store pointers to DevFSDeviceInode, but an IntrusiveList is used instead. Also, we only allow to remove device nodes for now, but in theory we can allow to remove all kinds of files from the DevFS.
2021-09-08Kernel: Expose device presence in /sys/dev/char and /sys/dev/blockLiav A
These files are not marked as block devices or character devices so they are not meant to be used as device nodes. The filenames are formatted to the pattern "major:minor", but a Userland program need to call the parse these format and inspect the the major and minor numbers and create the real device nodes in /dev. Later on, it might be a good idea to ensure we don't create new SysFSComponents on the heap for each Device, but rather generate them only when required (and preferably to not create a SysFSComponent at all if possible).
2021-09-08Kernel/VFS: Silence mknod debug spamLiav A
Since we populate the DevFS now in userspace, this creates a bunch of unnecessary noise in the kernel log.
2021-09-08Kernel+SystemServer: Defer creation of device nodes to userspaceLiav A
Don't create these device nodes in the Kernel, so we essentially enforce userspace (SystemServer) to take control of this operation and to decide how to create these device nodes. This makes the DevFS to resemble linux devtmpfs, and allows us to remove a bunch of unneeded overriding implementations of device name creation in the Kernel.
2021-09-08Kernel/DevFS: Simplify nodes insertion and lookupLiav A
Use IntrusiveList instead of a Vector to add inodes to a directory.
2021-09-07Kernel/TmpFS: Stop leaking directory entry metadataAndreas Kling
When creating and removing a child to a TmpFS directory, we were forgetting to delete the TmpFSInode::Child struct.
2021-09-07Kernel: Use OOM-safe absolute path serialization in InodeFile::mmap()Andreas Kling
Switch from OpenFileDescription::absolute_path() to the OOM-safe try_serialize_absolute_path() (and propagate any errors to the caller.)
2021-09-07Kernel: Make it possible for KBufferBuilder creation to failAndreas Kling
This patch adds KBufferBuilder::try_create() and treats it like anything else that can fail. And so, failure to allocate the initial internal buffer of the builder will now propagate an ENOMEM to the caller. :^)
2021-09-07Kernel: Make KBuffer::try_create_with_size() return KResultOrAndreas Kling
This allows us to use TRY() in a lot of new places.
2021-09-07Kernel: Use KResultOr and TRY() for FIFOAndreas Kling
2021-09-07Kernel: Make DoubleBuffer::try() return KResultOrAndreas Kling
This tidies up error propagation in a number of places.
2021-09-07Kernel: Rename FileDescription => OpenFileDescriptionAndreas Kling
Dr. POSIX really calls these "open file description", not just "file description", so let's call them exactly that. :^)
2021-09-07Kernel: Add FileDescription::try_serialize_absolute_path()Andreas Kling
Unlike FileDescription::absolute_path(), this knows that failures can happen and will propagate them to the caller.
2021-09-07Everywhere: Behaviour => BehaviorAndreas Kling
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