1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 10:45:09 +00:00

Kernel: Remove unused functions related to reading full inodes

This commit is contained in:
Tim Schumacher 2023-04-16 20:42:16 +02:00 committed by Linus Groh
parent f5010f7263
commit d4e114a31e
4 changed files with 0 additions and 36 deletions

View file

@ -51,30 +51,6 @@ void Inode::sync()
fs().flush_writes();
}
ErrorOr<NonnullOwnPtr<KBuffer>> Inode::read_entire(OpenFileDescription* description) const
{
auto builder = TRY(KBufferBuilder::try_create());
u8 buffer[4096];
off_t offset = 0;
for (;;) {
auto buf = UserOrKernelBuffer::for_kernel_buffer(buffer);
auto nread = TRY(read_bytes(offset, sizeof(buffer), buf, description));
VERIFY(nread <= sizeof(buffer));
if (nread == 0)
break;
TRY(builder.append((char const*)buffer, nread));
offset += nread;
if (nread < sizeof(buffer))
break;
}
auto entire_file = builder.build();
if (!entire_file)
return ENOMEM;
return entire_file.release_nonnull();
}
ErrorOr<NonnullRefPtr<Custody>> Inode::resolve_as_link(Credentials const& credentials, Custody& base, RefPtr<Custody>* out_parent, int options, int symlink_recursion_level) const
{
// The default implementation simply treats the stored