diff options
author | AnotherTest <ali.mpfard@gmail.com> | 2021-02-07 15:33:24 +0330 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-02-08 18:08:55 +0100 |
commit | 09a43969ba957b3484cc9387344fea145f46aa46 (patch) | |
tree | 0e2077e1d8af02b06e39cb4ca6cbfcba37052c73 /Kernel/FileSystem | |
parent | 1f8a633cc762fc3ca8544ee75ce25a7a8860d4be (diff) | |
download | serenity-09a43969ba957b3484cc9387344fea145f46aa46.zip |
Everywhere: Replace dbgln<flag>(...) with dbgln_if(flag, ...)
Replacement made by `find Kernel Userland -name '*.h' -o -name '*.cpp' | sed -i -Ee 's/dbgln\b<(\w+)>\(/dbgln_if(\1, /g'`
Diffstat (limited to 'Kernel/FileSystem')
-rw-r--r-- | Kernel/FileSystem/FileDescription.cpp | 4 | ||||
-rw-r--r-- | Kernel/FileSystem/ProcFS.cpp | 12 | ||||
-rw-r--r-- | Kernel/FileSystem/VirtualFileSystem.cpp | 4 |
3 files changed, 10 insertions, 10 deletions
diff --git a/Kernel/FileSystem/FileDescription.cpp b/Kernel/FileSystem/FileDescription.cpp index 762411d2be..bcc3baa8c9 100644 --- a/Kernel/FileSystem/FileDescription.cpp +++ b/Kernel/FileSystem/FileDescription.cpp @@ -49,7 +49,7 @@ KResultOr<NonnullRefPtr<FileDescription>> FileDescription::create(Custody& custo description->m_custody = custody; auto result = description->attach(); if (result.is_error()) { - dbgln<FILEDESCRIPTION_DEBUG>("Failed to create file description for custody: {}", result); + dbgln_if(FILEDESCRIPTION_DEBUG, "Failed to create file description for custody: {}", result); return result; } return description; @@ -60,7 +60,7 @@ KResultOr<NonnullRefPtr<FileDescription>> FileDescription::create(File& file) auto description = adopt(*new FileDescription(file)); auto result = description->attach(); if (result.is_error()) { - dbgln<FILEDESCRIPTION_DEBUG>("Failed to create file description for file: {}", result); + dbgln_if(FILEDESCRIPTION_DEBUG, "Failed to create file description for file: {}", result); return result; } return description; diff --git a/Kernel/FileSystem/ProcFS.cpp b/Kernel/FileSystem/ProcFS.cpp index 7646d5ce81..bb83131cf1 100644 --- a/Kernel/FileSystem/ProcFS.cpp +++ b/Kernel/FileSystem/ProcFS.cpp @@ -1015,7 +1015,7 @@ NonnullRefPtr<Inode> ProcFS::root_inode() const RefPtr<Inode> ProcFS::get_inode(InodeIdentifier inode_id) const { - dbgln<PROCFS_DEBUG>("ProcFS::get_inode({})", inode_id.index()); + dbgln_if(PROCFS_DEBUG, "ProcFS::get_inode({})", inode_id.index()); if (inode_id == root_inode()->identifier()) return m_root_inode; @@ -1128,7 +1128,7 @@ void ProcFSInode::did_seek(FileDescription& description, off_t new_offset) InodeMetadata ProcFSInode::metadata() const { - dbgln<PROCFS_DEBUG>("ProcFSInode::metadata({})", index()); + dbgln_if(PROCFS_DEBUG, "ProcFSInode::metadata({})", index()); InodeMetadata metadata; metadata.inode = identifier(); metadata.ctime = mepoch; @@ -1137,7 +1137,7 @@ InodeMetadata ProcFSInode::metadata() const auto proc_parent_directory = to_proc_parent_directory(identifier()); auto proc_file_type = to_proc_file_type(identifier()); - dbgln<PROCFS_DEBUG>(" -> pid={}, fi={}, pdi={}", to_pid(identifier()).value(), (int)proc_file_type, (int)proc_parent_directory); + dbgln_if(PROCFS_DEBUG, " -> pid={}, fi={}, pdi={}", to_pid(identifier()).value(), (int)proc_file_type, (int)proc_parent_directory); if (is_process_related_file(identifier())) { ProcessID pid = to_pid(identifier()); @@ -1210,14 +1210,14 @@ InodeMetadata ProcFSInode::metadata() const ssize_t ProcFSInode::read_bytes(off_t offset, ssize_t count, UserOrKernelBuffer& buffer, FileDescription* description) const { - dbgln<PROCFS_DEBUG>("ProcFS: read_bytes offset: {} count: {}", offset, count); + dbgln_if(PROCFS_DEBUG, "ProcFS: read_bytes offset: {} count: {}", offset, count); ASSERT(offset >= 0); ASSERT(buffer.user_or_kernel_ptr()); if (!description) return -EIO; if (!description->data()) { - dbgln<PROCFS_DEBUG>("ProcFS: Do not have cached data!"); + dbgln_if(PROCFS_DEBUG, "ProcFS: Do not have cached data!"); return -EIO; } @@ -1241,7 +1241,7 @@ InodeIdentifier ProcFS::ProcFSDirectoryEntry::identifier(unsigned fsid) const KResult ProcFSInode::traverse_as_directory(Function<bool(const FS::DirectoryEntryView&)> callback) const { - dbgln<PROCFS_DEBUG>("ProcFS: traverse_as_directory {}", index()); + dbgln_if(PROCFS_DEBUG, "ProcFS: traverse_as_directory {}", index()); if (!Kernel::is_directory(identifier())) return ENOTDIR; diff --git a/Kernel/FileSystem/VirtualFileSystem.cpp b/Kernel/FileSystem/VirtualFileSystem.cpp index 8b52fbffec..d5f28115dc 100644 --- a/Kernel/FileSystem/VirtualFileSystem.cpp +++ b/Kernel/FileSystem/VirtualFileSystem.cpp @@ -400,7 +400,7 @@ KResultOr<NonnullRefPtr<FileDescription>> VFS::create(StringView path, int optio if (parent_custody.is_readonly()) return EROFS; - dbgln<VFS_DEBUG>("VFS::create: '{}' in {}", p.basename(), parent_inode.identifier()); + dbgln_if(VFS_DEBUG, "VFS::create: '{}' in {}", p.basename(), parent_inode.identifier()); uid_t uid = owner.has_value() ? owner.value().uid : current_process->euid(); gid_t gid = owner.has_value() ? owner.value().gid : current_process->egid(); auto inode_or_error = parent_inode.create_child(p.basename(), mode, 0, uid, gid); @@ -442,7 +442,7 @@ KResult VFS::mkdir(StringView path, mode_t mode, Custody& base) return EROFS; LexicalPath p(path); - dbgln<VFS_DEBUG>("VFS::mkdir: '{}' in {}", p.basename(), parent_inode.identifier()); + dbgln_if(VFS_DEBUG, "VFS::mkdir: '{}' in {}", p.basename(), parent_inode.identifier()); return parent_inode.create_child(p.basename(), S_IFDIR | mode, 0, current_process->euid(), current_process->egid()).result(); } |