mirror of
https://github.com/RGBCube/serenity
synced 2025-05-30 18:28:10 +00:00
Kernel: Avoid an extra call to read_bytes() in Inode::read_entire()
If we slurp up the entire inode in a single read_bytes(), no need to call read_bytes() again.
This commit is contained in:
parent
09fd59a1b5
commit
5a13a5416e
1 changed files with 2 additions and 0 deletions
|
@ -45,6 +45,8 @@ ByteBuffer Inode::read_entire(FileDescription* descriptor) const
|
|||
break;
|
||||
builder.append((const char*)buffer, nread);
|
||||
offset += nread;
|
||||
if (nread < (ssize_t)sizeof(buffer))
|
||||
break;
|
||||
}
|
||||
if (nread < 0) {
|
||||
kprintf("Inode::read_entire: ERROR: %d\n", nread);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue