mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 09:51:57 -05:00
Kernel: Remove unused functions related to reading full inodes
This commit is contained in:
parent
f5010f7263
commit
d4e114a31e
4 changed files with 0 additions and 36 deletions
|
@ -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
|
||||
|
|
|
@ -53,8 +53,6 @@ public:
|
|||
InodeIdentifier identifier() const { return { fsid(), index() }; }
|
||||
virtual InodeMetadata metadata() const = 0;
|
||||
|
||||
ErrorOr<NonnullOwnPtr<KBuffer>> read_entire(OpenFileDescription* = nullptr) const;
|
||||
|
||||
ErrorOr<size_t> write_bytes(off_t, size_t, UserOrKernelBuffer const& data, OpenFileDescription*);
|
||||
ErrorOr<size_t> read_bytes(off_t, size_t, UserOrKernelBuffer& buffer, OpenFileDescription*) const;
|
||||
ErrorOr<size_t> read_until_filled_or_end(off_t, size_t, UserOrKernelBuffer buffer, OpenFileDescription*) const;
|
||||
|
|
|
@ -202,14 +202,6 @@ bool OpenFileDescription::can_read() const
|
|||
return m_file->can_read(*this, offset());
|
||||
}
|
||||
|
||||
ErrorOr<NonnullOwnPtr<KBuffer>> OpenFileDescription::read_entire_file()
|
||||
{
|
||||
// HACK ALERT: (This entire function)
|
||||
VERIFY(m_file->is_inode());
|
||||
VERIFY(m_inode);
|
||||
return m_inode->read_entire(this);
|
||||
}
|
||||
|
||||
ErrorOr<size_t> OpenFileDescription::get_dir_entries(UserOrKernelBuffer& output_buffer, size_t size)
|
||||
{
|
||||
if (!is_directory())
|
||||
|
|
|
@ -58,8 +58,6 @@ public:
|
|||
|
||||
ErrorOr<size_t> get_dir_entries(UserOrKernelBuffer& buffer, size_t);
|
||||
|
||||
ErrorOr<NonnullOwnPtr<KBuffer>> read_entire_file();
|
||||
|
||||
ErrorOr<NonnullOwnPtr<KString>> original_absolute_path() const;
|
||||
ErrorOr<NonnullOwnPtr<KString>> pseudo_path() const;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue