From 2e7728bb057f6f4bfe2cc856605f7fc9fcb9bec2 Mon Sep 17 00:00:00 2001 From: Brian Gianforcaro Date: Fri, 23 Jul 2021 08:19:32 -0700 Subject: [PATCH] Kernel: Use StringView literals for fs_type match in sys$mount(..) --- Kernel/Syscalls/mount.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Kernel/Syscalls/mount.cpp b/Kernel/Syscalls/mount.cpp index b83148f4b5..f9444595e8 100644 --- a/Kernel/Syscalls/mount.cpp +++ b/Kernel/Syscalls/mount.cpp @@ -67,7 +67,7 @@ KResultOr Process::sys$mount(Userspace RefPtr fs; - if (fs_type == "ext2" || fs_type == "Ext2FS") { + if (fs_type == "ext2"sv || fs_type == "Ext2FS"sv) { if (description.is_null()) return EBADF; if (!description->file().is_block_device()) @@ -80,20 +80,20 @@ KResultOr Process::sys$mount(Userspace dbgln("mount: attempting to mount {} on {}", description->absolute_path(), target); fs = Ext2FS::create(*description); - } else if (fs_type == "9p" || fs_type == "Plan9FS") { + } else if (fs_type == "9p"sv || fs_type == "Plan9FS"sv) { if (description.is_null()) return EBADF; fs = Plan9FS::create(*description); - } else if (fs_type == "proc" || fs_type == "ProcFS") { + } else if (fs_type == "proc"sv || fs_type == "ProcFS"sv) { fs = ProcFS::create(); - } else if (fs_type == "devpts" || fs_type == "DevPtsFS") { + } else if (fs_type == "devpts"sv || fs_type == "DevPtsFS"sv) { fs = DevPtsFS::create(); - } else if (fs_type == "dev" || fs_type == "DevFS") { + } else if (fs_type == "dev"sv || fs_type == "DevFS"sv) { fs = DevFS::create(); - } else if (fs_type == "sys" || fs_type == "SysFS") { + } else if (fs_type == "sys"sv || fs_type == "SysFS"sv) { fs = SysFS::create(); - } else if (fs_type == "tmp" || fs_type == "TmpFS") { + } else if (fs_type == "tmp"sv || fs_type == "TmpFS"sv) { fs = TmpFS::create(); } else { return ENODEV;