From a27c6f52268a6e85052f166cb9669207d4425b9f Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 7 Sep 2021 13:02:07 +0200 Subject: [PATCH] Kernel: Avoid unnecessary String allocation in sys$statvfs() --- Kernel/Process.h | 2 +- Kernel/Syscalls/statvfs.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel/Process.h b/Kernel/Process.h index 93a0f9674eb..b3ed33128bb 100644 --- a/Kernel/Process.h +++ b/Kernel/Process.h @@ -536,7 +536,7 @@ private: KResult do_exec(NonnullRefPtr main_program_description, Vector arguments, Vector environment, RefPtr interpreter_description, Thread*& new_main_thread, u32& prev_flags, const ElfW(Ehdr) & main_program_header); KResultOr do_write(FileDescription&, const UserOrKernelBuffer&, size_t); - KResultOr do_statvfs(String path, statvfs* buf); + KResultOr do_statvfs(StringView path, statvfs* buf); KResultOr> find_elf_interpreter_for_executable(String const& path, ElfW(Ehdr) const& main_executable_header, size_t main_executable_header_size, size_t file_size); diff --git a/Kernel/Syscalls/statvfs.cpp b/Kernel/Syscalls/statvfs.cpp index a530266c868..f5c5c8baee3 100644 --- a/Kernel/Syscalls/statvfs.cpp +++ b/Kernel/Syscalls/statvfs.cpp @@ -10,7 +10,7 @@ namespace Kernel { -KResultOr Process::do_statvfs(String path, statvfs* buf) +KResultOr Process::do_statvfs(StringView path, statvfs* buf) { auto custody = TRY(VirtualFileSystem::the().resolve_path(path, current_directory(), nullptr, 0)); auto& inode = custody->inode();