diff options
Diffstat (limited to 'kernel/filesystem/include')
9 files changed, 14 insertions, 13 deletions
diff --git a/kernel/filesystem/include/filesystem/custody.hpp b/kernel/filesystem/include/filesystem/custody.hpp index b6eae228..0124eb6c 100644 --- a/kernel/filesystem/include/filesystem/custody.hpp +++ b/kernel/filesystem/include/filesystem/custody.hpp @@ -9,10 +9,10 @@ namespace filesystem { struct custody { - custody(kstd::shared_ptr<custody> parent, kstd::shared_ptr<inode> node); + custody(kstd::shared_ptr<custody> const & parent, kstd::shared_ptr<inode> const & node); - [[nodiscard]] auto get_inode() const -> kstd::shared_ptr<inode>; - [[nodiscard]] auto get_parent() const -> kstd::shared_ptr<custody>; + [[nodiscard]] auto get_inode() const -> kstd::shared_ptr<inode> const &; + [[nodiscard]] auto get_parent() const -> kstd::shared_ptr<custody> const &; private: kstd::shared_ptr<custody> m_parent; diff --git a/kernel/filesystem/include/filesystem/device_file.hpp b/kernel/filesystem/include/filesystem/device_file.hpp index 4dce37f5..dad4ea51 100644 --- a/kernel/filesystem/include/filesystem/device_file.hpp +++ b/kernel/filesystem/include/filesystem/device_file.hpp @@ -13,7 +13,7 @@ namespace filesystem { struct device_file : file { - explicit device_file(kstd::shared_ptr<devices::device> device); + explicit device_file(kstd::shared_ptr<devices::device> const & device); auto open() -> void override; diff --git a/kernel/filesystem/include/filesystem/ext2/ext2_filesystem.hpp b/kernel/filesystem/include/filesystem/ext2/ext2_filesystem.hpp index dd52e727..37448a10 100644 --- a/kernel/filesystem/include/filesystem/ext2/ext2_filesystem.hpp +++ b/kernel/filesystem/include/filesystem/ext2/ext2_filesystem.hpp @@ -13,7 +13,7 @@ namespace filesystem::ext2 { struct ext2_filesystem : filesystem { - auto mount(kstd::shared_ptr<devices::device> device) -> int override; + auto mount(kstd::shared_ptr<devices::device> const & device) -> int override; auto lookup(inode const & parent, std::string_view name) -> inode * override; private: diff --git a/kernel/filesystem/include/filesystem/filesystem.hpp b/kernel/filesystem/include/filesystem/filesystem.hpp index eabefc02..934f8832 100644 --- a/kernel/filesystem/include/filesystem/filesystem.hpp +++ b/kernel/filesystem/include/filesystem/filesystem.hpp @@ -14,7 +14,7 @@ namespace filesystem { virtual ~filesystem() = default; - virtual auto mount(kstd::shared_ptr<devices::device> device) -> int = 0; + virtual auto mount(kstd::shared_ptr<devices::device> const & device) -> int = 0; virtual auto lookup(inode const & parent, std::string_view name) -> inode * = 0; [[nodiscard]] auto root_inode() const -> inode const &; diff --git a/kernel/filesystem/include/filesystem/inode.hpp b/kernel/filesystem/include/filesystem/inode.hpp index 2b5ee6ca..abfe2cf3 100644 --- a/kernel/filesystem/include/filesystem/inode.hpp +++ b/kernel/filesystem/include/filesystem/inode.hpp @@ -14,7 +14,7 @@ namespace filesystem { inode() = default; explicit inode(inode_kind kind); - explicit inode(kstd::shared_ptr<devices::device> device); + explicit inode(kstd::shared_ptr<devices::device> const & device); [[nodiscard]] auto metadata() const -> inode_metadata; @@ -24,7 +24,7 @@ namespace filesystem [[nodiscard]] auto is_block_device() const -> bool; [[nodiscard]] auto major_device() const -> size_t; [[nodiscard]] auto minor_device() const -> size_t; - [[nodiscard]] auto backing_device() const -> kstd::shared_ptr<devices::device>; + [[nodiscard]] auto backing_device() const -> kstd::shared_ptr<devices::device> const &; auto read(void * buffer, size_t offset, size_t size) const -> size_t; auto write(void const * buffer, size_t offset, size_t size) -> size_t; diff --git a/kernel/filesystem/include/filesystem/inode_file.hpp b/kernel/filesystem/include/filesystem/inode_file.hpp index 512f51de..5f8a95eb 100644 --- a/kernel/filesystem/include/filesystem/inode_file.hpp +++ b/kernel/filesystem/include/filesystem/inode_file.hpp @@ -12,7 +12,7 @@ namespace filesystem { struct inode_file : file { - explicit inode_file(kstd::shared_ptr<inode> inode); + explicit inode_file(kstd::shared_ptr<inode> const & inode); auto open() -> void override; diff --git a/kernel/filesystem/include/filesystem/mount.hpp b/kernel/filesystem/include/filesystem/mount.hpp index f28de749..46a68e24 100644 --- a/kernel/filesystem/include/filesystem/mount.hpp +++ b/kernel/filesystem/include/filesystem/mount.hpp @@ -11,10 +11,10 @@ namespace filesystem { struct mount { - mount(std::string_view const & path, kstd::shared_ptr<filesystem> fs); + mount(std::string_view const & path, kstd::shared_ptr<filesystem> const & fs); [[nodiscard]] auto path() const -> std::string_view; - [[nodiscard]] auto get_filesystem() const -> kstd::shared_ptr<filesystem>; + [[nodiscard]] auto get_filesystem() const -> kstd::shared_ptr<filesystem> const &; private: std::string_view m_path; diff --git a/kernel/filesystem/include/filesystem/open_file_description.hpp b/kernel/filesystem/include/filesystem/open_file_description.hpp index 035b0eeb..5ff094da 100644 --- a/kernel/filesystem/include/filesystem/open_file_description.hpp +++ b/kernel/filesystem/include/filesystem/open_file_description.hpp @@ -2,6 +2,7 @@ #define TEACH_OS_KERNEL_FILESYSTEM_OPEN_FILE_DESCRIPTION_HPP #include "file.hpp" + #include <kstd/memory> #include <cstddef> @@ -10,7 +11,7 @@ namespace filesystem { struct open_file_description { - open_file_description(kstd::shared_ptr<file> file); + open_file_description(kstd::shared_ptr<file> const & file); ~open_file_description() = default; diff --git a/kernel/filesystem/include/filesystem/vfs.hpp b/kernel/filesystem/include/filesystem/vfs.hpp index 9c890446..e16a9618 100644 --- a/kernel/filesystem/include/filesystem/vfs.hpp +++ b/kernel/filesystem/include/filesystem/vfs.hpp @@ -33,7 +33,7 @@ namespace filesystem }; vfs() = default; - auto make_device_node(kstd::shared_ptr<devices::device> device) -> void; + auto make_device_node(kstd::shared_ptr<devices::device> const & device) -> void; [[nodiscard]] auto resolve_path(std::string_view path) -> std::optional<custody>; kstd::shared_ptr<ext2::ext2_filesystem> m_root_fs; |
