1
Fork 0
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:
Andreas Kling 2020-01-15 22:09:45 +01:00
parent 09fd59a1b5
commit 5a13a5416e

View file

@ -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);