diff options
author | Andreas Kling <kling@serenityos.org> | 2021-08-28 23:53:29 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-08-29 01:09:19 +0200 |
commit | 8ebf08b6c8b43b0473f90d1b6118fa3e36275989 (patch) | |
tree | 1320d39e082c4e661fd7e60b21b107fbb0a2e570 /Kernel | |
parent | b959c1bfa976eebfb208c0ea0f806fec49b5b0a2 (diff) | |
download | serenity-8ebf08b6c8b43b0473f90d1b6118fa3e36275989.zip |
Kernel: Make all ProcFS and SysFS files zero-sized
There is no value in exposing particular sizes for these files.
Diffstat (limited to 'Kernel')
-rw-r--r-- | Kernel/Arch/PC/BIOS.h | 2 | ||||
-rw-r--r-- | Kernel/FileSystem/ProcFS.cpp | 2 | ||||
-rw-r--r-- | Kernel/FileSystem/SysFS.cpp | 2 | ||||
-rw-r--r-- | Kernel/FileSystem/SysFSComponent.h | 1 | ||||
-rw-r--r-- | Kernel/ProcessExposed.h | 1 |
5 files changed, 2 insertions, 6 deletions
diff --git a/Kernel/Arch/PC/BIOS.h b/Kernel/Arch/PC/BIOS.h index 486db3a17e..2981df91c6 100644 --- a/Kernel/Arch/PC/BIOS.h +++ b/Kernel/Arch/PC/BIOS.h @@ -70,7 +70,6 @@ protected: class DMIEntryPointExposedBlob : public BIOSSysFSComponent { public: static NonnullRefPtr<DMIEntryPointExposedBlob> create(PhysicalAddress dmi_entry_point, size_t blob_size); - virtual size_t size() const override { return m_dmi_entry_point_length; } private: DMIEntryPointExposedBlob(PhysicalAddress dmi_entry_point, size_t blob_size); @@ -82,7 +81,6 @@ private: class SMBIOSExposedTable : public BIOSSysFSComponent { public: static NonnullRefPtr<SMBIOSExposedTable> create(PhysicalAddress, size_t blob_size); - virtual size_t size() const override { return m_smbios_structure_table_length; } private: SMBIOSExposedTable(PhysicalAddress dmi_entry_point, size_t blob_size); diff --git a/Kernel/FileSystem/ProcFS.cpp b/Kernel/FileSystem/ProcFS.cpp index 3174af40e9..fb5e51d068 100644 --- a/Kernel/FileSystem/ProcFS.cpp +++ b/Kernel/FileSystem/ProcFS.cpp @@ -163,7 +163,7 @@ InodeMetadata ProcFSGlobalInode::metadata() const metadata.mode = S_IFREG | m_associated_component->required_mode(); metadata.uid = m_associated_component->owner_user(); metadata.gid = m_associated_component->owner_group(); - metadata.size = m_associated_component->size(); + metadata.size = 0; metadata.mtime = m_associated_component->modified_time(); return metadata; } diff --git a/Kernel/FileSystem/SysFS.cpp b/Kernel/FileSystem/SysFS.cpp index ed925c93b8..32af2e0391 100644 --- a/Kernel/FileSystem/SysFS.cpp +++ b/Kernel/FileSystem/SysFS.cpp @@ -119,7 +119,7 @@ InodeMetadata SysFSInode::metadata() const metadata.mode = S_IFREG | S_IRUSR | S_IRGRP | S_IROTH; metadata.uid = 0; metadata.gid = 0; - metadata.size = m_associated_component->size(); + metadata.size = 0; metadata.mtime = mepoch; return metadata; } diff --git a/Kernel/FileSystem/SysFSComponent.h b/Kernel/FileSystem/SysFSComponent.h index 3bbf6019c9..3e29138a5f 100644 --- a/Kernel/FileSystem/SysFSComponent.h +++ b/Kernel/FileSystem/SysFSComponent.h @@ -25,7 +25,6 @@ public: virtual KResult traverse_as_directory(unsigned, Function<bool(FileSystem::DirectoryEntryView const&)>) const { VERIFY_NOT_REACHED(); } virtual RefPtr<SysFSComponent> lookup(StringView) { VERIFY_NOT_REACHED(); }; virtual KResultOr<size_t> write_bytes(off_t, size_t, UserOrKernelBuffer const&, FileDescription*) { return EROFS; } - virtual size_t size() const { return 0; } virtual NonnullRefPtr<Inode> to_inode(SysFS const&) const; diff --git a/Kernel/ProcessExposed.h b/Kernel/ProcessExposed.h index c74cfc983f..968a3b5e25 100644 --- a/Kernel/ProcessExposed.h +++ b/Kernel/ProcessExposed.h @@ -70,7 +70,6 @@ public: virtual KResult traverse_as_directory(unsigned, Function<bool(FileSystem::DirectoryEntryView const&)>) const { VERIFY_NOT_REACHED(); } virtual KResultOr<NonnullRefPtr<ProcFSExposedComponent>> lookup(StringView) { VERIFY_NOT_REACHED(); }; virtual KResultOr<size_t> write_bytes(off_t, size_t, const UserOrKernelBuffer&, FileDescription*) { return KResult(EROFS); } - virtual size_t size() const { return 0; } virtual mode_t required_mode() const { return 0444; } virtual UserID owner_user() const { return 0; } |