aboutsummaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@ost.ch>2026-08-31 09:21:51 +0200
committerFelix Morgner <felix.morgner@ost.ch>2026-08-31 09:21:51 +0200
commitbb95c10727d4a5b9f8226462ed1bee15a71fd33c (patch)
tree8a0d1e81ddeee7529b9601a44ee381d2c269e099 /kernel
parent66e232270ab77acf13f146f6ed49faae467994db (diff)
downloadkernel-bb95c10727d4a5b9f8226462ed1bee15a71fd33c.tar.xz
kernel-bb95c10727d4a5b9f8226462ed1bee15a71fd33c.zip
chore: minor stylistic cleanups
Diffstat (limited to 'kernel')
-rw-r--r--kernel/kernel/test_support/log_buffer.hpp4
-rw-r--r--kernel/kernel/vfs.hpp21
-rw-r--r--kernel/kernel/vfs/dentry.hpp2
-rw-r--r--kernel/kernel/vfs/driver_state.hpp4
4 files changed, 16 insertions, 15 deletions
diff --git a/kernel/kernel/test_support/log_buffer.hpp b/kernel/kernel/test_support/log_buffer.hpp
index b1ba6e0a..f3ac3e10 100644
--- a/kernel/kernel/test_support/log_buffer.hpp
+++ b/kernel/kernel/test_support/log_buffer.hpp
@@ -1,5 +1,5 @@
-#ifndef KERNEL_TEST_SUPPORT_LOG_BUFFER_HPP
-#define KERNEL_TEST_SUPPORT_LOG_BUFFER_HPP
+#ifndef TEACHOS_KERNEL_TEST_SUPPORT_LOG_BUFFER_HPP
+#define TEACHOS_KERNEL_TEST_SUPPORT_LOG_BUFFER_HPP
#include <mutex>
#include <string>
diff --git a/kernel/kernel/vfs.hpp b/kernel/kernel/vfs.hpp
index a722a48d..4225eef9 100644
--- a/kernel/kernel/vfs.hpp
+++ b/kernel/kernel/vfs.hpp
@@ -64,39 +64,39 @@ namespace kernel::vfs
//!
//! @param path The path to the file to open.
//! @return A shared pointer to the dentry on success or an error code on failure.
- auto open(std::string_view path) -> kstd::result<dentry_ptr>;
+ [[nodiscard]] auto open(std::string_view path) -> kstd::result<dentry_ptr>;
//! Close a file by its associated path.
//!
//! @param path The path to the file to close.
//! @return Nothing on success or an error code on failure.
- auto close(std::string_view path) -> kstd::result<void>;
+ [[nodiscard]] auto close(std::string_view path) -> kstd::result<void>;
//! Mount a source path to a specific target path.
//!
//! @param source The source of the filesystem to mount.
//! @param target The path where the filesystem should be mounted.
//! @return Nothing on success or an error code on failure.
- auto mount(std::string_view source, std::string_view target) -> kstd::result<void>;
+ [[nodiscard]] auto mount(std::string_view source, std::string_view target) -> kstd::result<void>;
//! Unmount the filesystem mounted at the specified path.
//!
//! @param path The path where the filesystem is mounted.
//! @return Nothing on success or an error code on failure.
- auto unmount(std::string_view path) -> kstd::result<void>;
+ [[nodiscard]] auto unmount(std::string_view path) -> kstd::result<void>;
//! Create a new directory at the specified path.
//!
//! @param path The path where the new directory should be created.
//! @return Nothing on success, an error otherwise.
- auto mkdir(std::string_view path) -> kstd::result<void>;
+ [[nodiscard]] auto mkdir(std::string_view path) -> kstd::result<void>;
//! Create a new file at the specified path.
//!
//! @param path The path where the new file should be created.
//! @return Nothing on success, an error otherwise.
// TODO remove after the open method supports flags.
- auto create(std::string_view path) -> kstd::result<void>;
+ [[nodiscard]] auto create(std::string_view path) -> kstd::result<void>;
//! Get the status of the file at a given path.
//!
@@ -106,8 +106,8 @@ namespace kernel::vfs
//! Create a new device node at a given path.
//!
//! @return Nothing on success, an error otherwise.
- auto create_device_node(std::string_view path, std::uint32_t mode, kapi::filesystem::device_number device)
- -> kstd::result<void>;
+ [[nodiscard]] auto create_device_node(std::string_view path, std::uint32_t mode,
+ kapi::filesystem::device_number device) -> kstd::result<void>;
//! Check if a given given dentry houses any mounts.
//!
@@ -138,8 +138,9 @@ namespace kernel::vfs
[[nodiscard]] auto find_mount(std::string_view path) const -> kstd::result<mount_ptr>;
- auto create_inode(std::string_view path, kapi::filesystem::file_type type,
- std::optional<kapi::filesystem::device_number> raw_device = std::nullopt) -> kstd::result<void>;
+ [[nodiscard]] auto create_inode(std::string_view path, kapi::filesystem::file_type type,
+ std::optional<kapi::filesystem::device_number> raw_device = std::nullopt)
+ -> kstd::result<void>;
mount_table m_mount_table{};
};
diff --git a/kernel/kernel/vfs/dentry.hpp b/kernel/kernel/vfs/dentry.hpp
index 0c669854..5bb77fab 100644
--- a/kernel/kernel/vfs/dentry.hpp
+++ b/kernel/kernel/vfs/dentry.hpp
@@ -19,7 +19,7 @@ namespace kernel::vfs
using inode_ptr = kstd::shared_ptr<kernel::vfs::inode>;
//! Flags for the dentry.
- enum class dentry_flags : std::uint32_t
+ enum struct dentry_flags : std::uint32_t
{
is_mount_point = 1 << 0
};
diff --git a/kernel/kernel/vfs/driver_state.hpp b/kernel/kernel/vfs/driver_state.hpp
index 2756ea8a..b354f6b1 100644
--- a/kernel/kernel/vfs/driver_state.hpp
+++ b/kernel/kernel/vfs/driver_state.hpp
@@ -1,5 +1,5 @@
-#ifndef KERNEL_VFS_DRIVER_STATE_HPP
-#define KERNEL_VFS_DRIVER_STATE_HPP
+#ifndef TEACHOS_KERNEL_VFS_DRIVER_STATE_HPP
+#define TEACHOS_KERNEL_VFS_DRIVER_STATE_HPP
#include <kstd/memory.hpp>