From 66f483b1a19ed7ed5f9cf54483d16bb8b956c2cc Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 11 Jul 2021 00:56:53 +0200 Subject: Kerne: Switch SysFS to east-const style --- Kernel/FileSystem/SysFS.cpp | 17 ++++++++--------- Kernel/FileSystem/SysFS.h | 18 +++++++++--------- 2 files changed, 17 insertions(+), 18 deletions(-) (limited to 'Kernel/FileSystem') diff --git a/Kernel/FileSystem/SysFS.cpp b/Kernel/FileSystem/SysFS.cpp index d737f7f2d8..cc16af1782 100644 --- a/Kernel/FileSystem/SysFS.cpp +++ b/Kernel/FileSystem/SysFS.cpp @@ -5,7 +5,6 @@ */ #include -#include #include #include #include @@ -85,12 +84,12 @@ NonnullRefPtr SysFS::root_inode() const return *m_root_inode; } -NonnullRefPtr SysFSInode::create(const SysFS& fs, const SystemExposedComponent& component) +NonnullRefPtr SysFSInode::create(SysFS const& fs, SystemExposedComponent const& component) { return adopt_ref(*new (nothrow) SysFSInode(fs, component)); } -SysFSInode::SysFSInode(const SysFS& fs, const SystemExposedComponent& component) +SysFSInode::SysFSInode(SysFS const& fs, SystemExposedComponent const& component) : Inode(const_cast(fs), component.component_index()) , m_associated_component(component) { @@ -128,22 +127,22 @@ void SysFSInode::flush_metadata() { } -KResultOr SysFSInode::write_bytes(off_t offset, size_t count, const UserOrKernelBuffer& buffer, FileDescription* fd) +KResultOr SysFSInode::write_bytes(off_t offset, size_t count, UserOrKernelBuffer const& buffer, FileDescription* fd) { return m_associated_component->write_bytes(offset, count, buffer, fd); } -KResultOr> SysFSInode::create_child(const String&, mode_t, dev_t, uid_t, gid_t) +KResultOr> SysFSInode::create_child(String const&, mode_t, dev_t, uid_t, gid_t) { return EROFS; } -KResult SysFSInode::add_child(Inode&, const StringView&, mode_t) +KResult SysFSInode::add_child(Inode&, StringView const&, mode_t) { return EROFS; } -KResult SysFSInode::remove_child(const StringView&) +KResult SysFSInode::remove_child(StringView const&) { return EROFS; } @@ -168,12 +167,12 @@ KResult SysFSInode::truncate(u64) return EPERM; } -NonnullRefPtr SysFSDirectoryInode::create(const SysFS& sysfs, const SystemExposedComponent& component) +NonnullRefPtr SysFSDirectoryInode::create(SysFS const& sysfs, SystemExposedComponent const& component) { return adopt_ref(*new (nothrow) SysFSDirectoryInode(sysfs, component)); } -SysFSDirectoryInode::SysFSDirectoryInode(const SysFS& fs, const SystemExposedComponent& component) +SysFSDirectoryInode::SysFSDirectoryInode(SysFS const& fs, SystemExposedComponent const& component) : SysFSInode(fs, component) , m_parent_fs(const_cast(fs)) { diff --git a/Kernel/FileSystem/SysFS.h b/Kernel/FileSystem/SysFS.h index 68779256cd..7fe8a82806 100644 --- a/Kernel/FileSystem/SysFS.h +++ b/Kernel/FileSystem/SysFS.h @@ -62,7 +62,7 @@ public: static NonnullRefPtr create(); virtual bool initialize() override; - virtual const char* class_name() const override { return "SysFS"; } + virtual char const* class_name() const override { return "SysFS"; } virtual NonnullRefPtr root_inode() const override; @@ -77,20 +77,20 @@ class SysFSInode : public Inode { friend class SysFSDirectoryInode; public: - static NonnullRefPtr create(const SysFS&, const SystemExposedComponent&); + static NonnullRefPtr create(SysFS const&, SystemExposedComponent const&); StringView name() const { return m_associated_component->name(); } protected: - SysFSInode(const SysFS&, const SystemExposedComponent&); + SysFSInode(SysFS const&, SystemExposedComponent const&); virtual KResultOr read_bytes(off_t, size_t, UserOrKernelBuffer& buffer, FileDescription*) const override; virtual KResult traverse_as_directory(Function) const override; virtual RefPtr lookup(StringView name) override; virtual void flush_metadata() override; virtual InodeMetadata metadata() const override; - virtual KResultOr write_bytes(off_t, size_t, const UserOrKernelBuffer& buffer, FileDescription*) override; - virtual KResultOr> create_child(const String& name, mode_t, dev_t, uid_t, gid_t) override; - virtual KResult add_child(Inode&, const StringView& name, mode_t) override; - virtual KResult remove_child(const StringView& name) override; + virtual KResultOr write_bytes(off_t, size_t, UserOrKernelBuffer const&, FileDescription*) override; + virtual KResultOr> create_child(String const& name, mode_t, dev_t, uid_t, gid_t) override; + virtual KResult add_child(Inode&, StringView const& name, mode_t) override; + virtual KResult remove_child(StringView const& name) override; virtual KResultOr directory_entry_count() const override; virtual KResult chmod(mode_t) override; virtual KResult chown(uid_t, gid_t) override; @@ -104,11 +104,11 @@ class SysFSDirectoryInode : public SysFSInode { friend class SysFSRootDirectoryInode; public: - static NonnullRefPtr create(const SysFS&, const SystemExposedComponent&); + static NonnullRefPtr create(SysFS const&, SystemExposedComponent const&); virtual ~SysFSDirectoryInode() override; protected: - SysFSDirectoryInode(const SysFS&, const SystemExposedComponent&); + SysFSDirectoryInode(SysFS const&, SystemExposedComponent const&); // ^Inode virtual InodeMetadata metadata() const override; virtual KResult traverse_as_directory(Function) const override; -- cgit v1.2.3