Kernel: Avoid unnecessary String allocation in sys$statvfs()

This commit is contained in:
Andreas Kling 2021-09-07 13:02:07 +02:00
parent 6ad427993a
commit a27c6f5226
Notes: sideshowbarker 2024-07-18 04:31:59 +09:00
2 changed files with 2 additions and 2 deletions

View file

@ -536,7 +536,7 @@ private:
KResult do_exec(NonnullRefPtr<FileDescription> main_program_description, Vector<String> arguments, Vector<String> environment, RefPtr<FileDescription> interpreter_description, Thread*& new_main_thread, u32& prev_flags, const ElfW(Ehdr) & main_program_header);
KResultOr<FlatPtr> do_write(FileDescription&, const UserOrKernelBuffer&, size_t);
KResultOr<FlatPtr> do_statvfs(String path, statvfs* buf);
KResultOr<FlatPtr> do_statvfs(StringView path, statvfs* buf);
KResultOr<RefPtr<FileDescription>> find_elf_interpreter_for_executable(String const& path, ElfW(Ehdr) const& main_executable_header, size_t main_executable_header_size, size_t file_size);

View file

@ -10,7 +10,7 @@
namespace Kernel {
KResultOr<FlatPtr> Process::do_statvfs(String path, statvfs* buf)
KResultOr<FlatPtr> Process::do_statvfs(StringView path, statvfs* buf)
{
auto custody = TRY(VirtualFileSystem::the().resolve_path(path, current_directory(), nullptr, 0));
auto& inode = custody->inode();