summaryrefslogtreecommitdiff
path: root/Kernel
diff options
context:
space:
mode:
authorIdan Horowitz <idan.horowitz@gmail.com>2022-01-11 22:01:44 +0200
committerIdan Horowitz <idan.horowitz@gmail.com>2022-01-12 16:09:09 +0200
commitd1d24eaef49d48ce88716e10039e9f63d286f385 (patch)
tree57387205abf30e4f53ecd2a5f71c5aa70daa09cf /Kernel
parent8a4654a9243deb3db759ca071debdacc64e1e2db (diff)
downloadserenity-d1d24eaef49d48ce88716e10039e9f63d286f385.zip
Kernel: Use a StringView for Ext2FSDirectoryEntry::name
This is a temporary struct, so there's no need to allocate a long term storage for these strings.
Diffstat (limited to 'Kernel')
-rw-r--r--Kernel/FileSystem/Ext2FileSystem.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/Kernel/FileSystem/Ext2FileSystem.cpp b/Kernel/FileSystem/Ext2FileSystem.cpp
index 46ca7142ff..ab91c4841b 100644
--- a/Kernel/FileSystem/Ext2FileSystem.cpp
+++ b/Kernel/FileSystem/Ext2FileSystem.cpp
@@ -24,7 +24,7 @@ static constexpr size_t max_block_size = 4096;
static constexpr size_t max_inline_symlink_length = 60;
struct Ext2FSDirectoryEntry {
- String name;
+ StringView name;
InodeIndex inode_index { 0 };
u8 file_type { 0 };
u16 record_length { 0 };
@@ -1463,8 +1463,8 @@ ErrorOr<NonnullRefPtr<Inode>> Ext2FS::create_directory(Ext2FSInode& parent_inode
dbgln_if(EXT2_DEBUG, "Ext2FS: create_directory: created new directory named '{} with inode {}", name, inode->index());
Vector<Ext2FSDirectoryEntry> entries;
- TRY(entries.try_empend(".", inode->index(), static_cast<u8>(EXT2_FT_DIR)));
- TRY(entries.try_empend("..", parent_inode.index(), static_cast<u8>(EXT2_FT_DIR)));
+ TRY(entries.try_empend("."sv, inode->index(), static_cast<u8>(EXT2_FT_DIR)));
+ TRY(entries.try_empend(".."sv, parent_inode.index(), static_cast<u8>(EXT2_FT_DIR)));
TRY(static_cast<Ext2FSInode&>(*inode).write_directory(entries));
TRY(parent_inode.increment_link_count());