mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:37:35 +00:00
Kernel: Add KBuffer::bytes() and use it
(Instead of hand-wrapping { data(), size() } in a bunch of places.)
This commit is contained in:
parent
bee2de4b31
commit
524ef5e475
7 changed files with 9 additions and 7 deletions
|
@ -75,8 +75,7 @@ KResultOr<NonnullRefPtr<Custody>> Inode::resolve_as_link(Custody& base, RefPtr<C
|
|||
// contents as a path and resolves that. That is, it
|
||||
// behaves exactly how you would expect a symlink to work.
|
||||
auto contents = TRY(read_entire());
|
||||
auto path = StringView(contents->data(), contents->size());
|
||||
return VirtualFileSystem::the().resolve_path(path, base, out_parent, options, symlink_recursion_level);
|
||||
return VirtualFileSystem::the().resolve_path(StringView { contents->bytes() }, base, out_parent, options, symlink_recursion_level);
|
||||
}
|
||||
|
||||
Inode::Inode(FileSystem& fs, InodeIndex index)
|
||||
|
|
|
@ -333,7 +333,7 @@ Plan9FS::Message::Message(Plan9FS& fs, Type type)
|
|||
}
|
||||
|
||||
Plan9FS::Message::Message(NonnullOwnPtr<KBuffer>&& buffer)
|
||||
: m_built { move(buffer), Decoder({ buffer->data(), buffer->size() }) }
|
||||
: m_built { move(buffer), Decoder({ buffer->bytes() }) }
|
||||
, m_have_been_built(true)
|
||||
{
|
||||
u32 size;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue