From 9d736772bddb22048cdd95847835cd9b9dd31ca3 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 4 Sep 2021 23:43:00 +0200 Subject: [PATCH] Kernel/Ext2FS: Remove a String allocation in debug logging We were creating a temporary String just to log the target when writing a symlink directly into inline storage. --- Kernel/FileSystem/Ext2FileSystem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kernel/FileSystem/Ext2FileSystem.cpp b/Kernel/FileSystem/Ext2FileSystem.cpp index a961a6869b..ce2fca0173 100644 --- a/Kernel/FileSystem/Ext2FileSystem.cpp +++ b/Kernel/FileSystem/Ext2FileSystem.cpp @@ -999,7 +999,7 @@ KResultOr Ext2FSInode::write_bytes(off_t offset, size_t count, const Use if (is_symlink()) { VERIFY(offset == 0); if (max((size_t)(offset + count), (size_t)m_raw_inode.i_size) < max_inline_symlink_length) { - dbgln_if(EXT2_DEBUG, "Ext2FSInode[{}]::write_bytes(): Poking into i_block array for inline symlink '{}' ({} bytes)", identifier(), data.copy_into_string(count), count); + dbgln_if(EXT2_DEBUG, "Ext2FSInode[{}]::write_bytes(): Poking into i_block array for inline symlink ({} bytes)", identifier(), count); if (!data.read(((u8*)m_raw_inode.i_block) + offset, (size_t)count)) return EFAULT; if ((size_t)(offset + count) > (size_t)m_raw_inode.i_size)