aboutsummaryrefslogtreecommitdiff
path: root/kernel/kernel/filesystem/vfs.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/kernel/filesystem/vfs.hpp')
-rw-r--r--kernel/kernel/filesystem/vfs.hpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/kernel/kernel/filesystem/vfs.hpp b/kernel/kernel/filesystem/vfs.hpp
index 9dfd3637..beb336a4 100644
--- a/kernel/kernel/filesystem/vfs.hpp
+++ b/kernel/kernel/filesystem/vfs.hpp
@@ -6,6 +6,7 @@
#include <kernel/filesystem/filesystem.hpp>
#include <kernel/filesystem/mount.hpp>
#include <kernel/filesystem/mount_table.hpp>
+#include <kernel/filesystem/vfs_types.hpp>
#include <kstd/memory.hpp>
#include <kstd/result.hpp>
@@ -77,6 +78,21 @@ namespace kernel::filesystem
*/
auto unmount(std::string_view path) -> kstd::result<void>;
+ /**
+ @brief Create a new directory at the specified @p path.
+ @param path The path where the new directory should be created.
+ @return The result of the mkdir operation.
+ */
+ auto mkdir(std::string_view path) -> kstd::result<void>;
+
+ /**
+ @brief Create a new file at the specified @p path.
+ @param path The path where the new file should be created.
+ @return The result of the create operation.
+ */
+ // TODO remove again after the open method supports an optional create flag
+ auto create(std::string_view path) -> kstd::result<void>;
+
private:
/**
* Note: Resolving a dentry requires traversing mount points; since the
@@ -100,6 +116,8 @@ namespace kernel::filesystem
auto graft_persistent_device_fs(kstd::shared_ptr<devfs::filesystem> const & device_fs) -> void;
+ auto create_inode(std::string_view path, vfs_types::inode_type type) -> kstd::result<void>;
+
mount_table m_mount_table{};
};
} // namespace kernel::filesystem