mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 07:27:45 +00:00
Kernel/SysFS: Don't compute exact size of PCI files
There's no need for generated files in SysFS to tell you their precise file size when you stat() them. I noticed when profiling "find /" that we were spending a chunk of time generating and throwing away SysFS content just so we could tell you exactly how large it would be. :^)
This commit is contained in:
parent
f633ef2af7
commit
9c373b646b
2 changed files with 0 additions and 9 deletions
|
@ -430,14 +430,6 @@ KResultOr<size_t> PCIDeviceAttributeSysFSComponent::read_bytes(off_t offset, siz
|
|||
return nread;
|
||||
}
|
||||
|
||||
size_t PCIDeviceAttributeSysFSComponent::size() const
|
||||
{
|
||||
auto buffer = try_to_generate_buffer();
|
||||
if (!buffer)
|
||||
return 0;
|
||||
return buffer->size();
|
||||
}
|
||||
|
||||
OwnPtr<KBuffer> PCIDeviceAttributeSysFSComponent::try_to_generate_buffer() const
|
||||
{
|
||||
String value;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue