1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-21 23:05:07 +00:00
serenity/Kernel/FileSystem
Liav A f8489da8ee Kernel/SysFS: Provide a way to "truncate" and "set" mtime on inodes
Normally, trying to truncate a SysFSInode should result in EPERM error.
However, as suggested by Ali (@alimpfard), we can allow the PowerState
node to be "truncated" so one can open that file with O_TRUNC option.
Likewise, we also need to provide a way to set modified time on SysFS
inodes. For most inodes, we should return ENOTIMPL error, but for the
power state switch, we ignore the modified time setting and just return
KSuccess.

These fixes allow to do "echo -n 1 > /sys/firmware/power_state" in Shell
after gaining root permissions, to switch the power state.
2021-10-09 12:07:56 +02:00
..
AnonymousFile.cpp Kernel: Rename FileDescription => OpenFileDescription 2021-09-07 13:53:14 +02:00
AnonymousFile.h Kernel: Use operator ""sv in all class_name() implementations 2021-10-03 13:36:10 +02:00
BlockBasedFileSystem.cpp AK+Everywhere: Reduce the number of template parameters of IntrusiveList 2021-09-10 18:05:46 +03:00
BlockBasedFileSystem.h Kernel: Rename FileDescription => OpenFileDescription 2021-09-07 13:53:14 +02:00
Custody.cpp Kernel: Make KString factories return KResultOr + use TRY() everywhere 2021-09-06 19:25:36 +02:00
Custody.h AK+Everywhere: Reduce the number of template parameters of IntrusiveList 2021-09-10 18:05:46 +03:00
DevPtsFS.cpp Kernel: Introduce the DeviceManagement singleton 2021-09-17 01:02:48 +03:00
DevPtsFS.h Kernel: Rename FileDescription => OpenFileDescription 2021-09-07 13:53:14 +02:00
DevTmpFS.cpp Kernel: Introduce the DeviceManagement singleton 2021-09-17 01:02:48 +03:00
DevTmpFS.h AK+Everywhere: Reduce the number of template parameters of IntrusiveList 2021-09-10 18:05:46 +03:00
ext2_fs.h Everywhere: Behaviour => Behavior 2021-09-07 13:53:14 +02:00
ext2_types.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
Ext2FileSystem.cpp Kernel: Make KBuffer::try_create_with_size() return KResultOr 2021-09-07 15:15:08 +02:00
Ext2FileSystem.h Kernel: Rename FileDescription => OpenFileDescription 2021-09-07 13:53:14 +02:00
FIFO.cpp Kernel: Use KResultOr and TRY() for FIFO 2021-09-07 13:58:16 +02:00
FIFO.h Kernel: Use operator ""sv in all class_name() implementations 2021-10-03 13:36:10 +02:00
File.cpp Kernel/Devices: Defer creation of SysFS component after the constructor 2021-09-11 11:41:14 +02:00
File.h Kernel+LibC: Implement fsync 2021-09-12 11:24:02 +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+LibC: Implement fsync 2021-09-12 11:24:02 +02:00
FileSystem.h AK+Kernel: Move KResult.h to Kernel/API for userspace access 2021-09-05 12:54:48 +02:00
Inode.cpp Kernel: Pack Flock struct tighter 2021-09-16 17:17:13 +02:00
Inode.h Kernel: Pack Flock struct tighter 2021-09-16 17:17:13 +02:00
InodeFile.cpp Kernel+LibC: Implement fsync 2021-09-12 11:24:02 +02:00
InodeFile.h Kernel: Use operator ""sv in all class_name() implementations 2021-10-03 13:36:10 +02:00
InodeIdentifier.h Kernel: Rename FS => FileSystem 2021-07-11 00:20:38 +02:00
InodeMetadata.h Kernel+SystemServer: Defer creation of device nodes to userspace 2021-09-08 00:42:20 +02:00
InodeWatcher.cpp Kernel: Rename FileDescription => OpenFileDescription 2021-09-07 13:53:14 +02:00
InodeWatcher.h Kernel: Use operator ""sv in all class_name() implementations 2021-10-03 13:36:10 +02:00
ISO9660FileSystem.cpp Kernel: Make KBuffer::try_create_with_size() return KResultOr 2021-09-07 15:15:08 +02:00
ISO9660FileSystem.h Kernel: Use operator ""sv in all class_name() implementations 2021-10-03 13:36:10 +02:00
Mount.cpp Kernel: Make VirtualFileSystem::Mount a top-level class 2021-07-11 00:51:06 +02:00
Mount.h Kernel/Ext2FS: Cache the root inode in a member variable 2021-07-18 01:53:04 +02:00
OpenFileDescription.cpp Kernel+LibC: Implement fsync 2021-09-12 11:24:02 +02:00
OpenFileDescription.h Kernel+LibC: Implement fsync 2021-09-12 11:24:02 +02:00
Plan9FileSystem.cpp Kernel: Add KBuffer::bytes() and use it 2021-09-08 20:16:00 +02:00
Plan9FileSystem.h Kernel: Rename FileDescription => OpenFileDescription 2021-09-07 13:53:14 +02:00
ProcFS.cpp Kernel: Make it possible for KBufferBuilder creation to fail 2021-09-07 15:54:23 +02:00
ProcFS.h Kernel: Rename FileDescription => OpenFileDescription 2021-09-07 13:53:14 +02:00
SysFS.cpp Kernel/SysFS: Provide a way to "truncate" and "set" mtime on inodes 2021-10-09 12:07:56 +02:00
SysFS.h Kernel/SysFS: Provide a way to "truncate" and "set" mtime on inodes 2021-10-09 12:07:56 +02:00
SysFSComponent.cpp Kernel/SysFS: Make it possible to have custom permissions for nodes 2021-09-12 11:52:16 +02:00
SysFSComponent.h Kernel/SysFS: Provide a way to "truncate" and "set" mtime on inodes 2021-10-09 12:07:56 +02:00
TmpFS.cpp Kernel/TmpFS: Stop leaking directory entry metadata 2021-09-07 22:16:25 +02:00
TmpFS.h AK+Everywhere: Reduce the number of template parameters of IntrusiveList 2021-09-10 18:05:46 +03:00
UnveilNode.h Kernel: Move UnveilNode.h into Kernel/FileSystem/ 2021-08-06 14:11:45 +02:00
VirtualFileSystem.cpp Kernel: Introduce the DeviceManagement singleton 2021-09-17 01:02:48 +03:00
VirtualFileSystem.h Kernel: Rename FileDescription => OpenFileDescription 2021-09-07 13:53:14 +02:00