From 01c570789d7f9ccc1521b791903c8a499b0f6323 Mon Sep 17 00:00:00 2001
From: Marvin Borner
Date: Fri, 8 Jan 2021 14:51:11 +0100
Subject: Kinda working VFS implementation

---
 kernel/inc/fs.h | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

(limited to 'kernel/inc')

diff --git a/kernel/inc/fs.h b/kernel/inc/fs.h
index 7831603..06154e7 100644
--- a/kernel/inc/fs.h
+++ b/kernel/inc/fs.h
@@ -4,6 +4,7 @@
 #define FS_H
 
 #include <def.h>
+#include <sys.h>
 
 /**
  * Device
@@ -29,8 +30,9 @@ enum vfs_type { VFS_DEVFS, VFS_TMPFS, VFS_PROCFS, VFS_EXT2 };
 struct vfs {
 	enum vfs_type type;
 	int flags;
-	u32 (*read)(char *path, void *buf, u32 offset, u32 count, struct device *dev);
-	u32 (*write)(char *path, void *buf, u32 offset, u32 count, struct device *dev);
+	u32 (*read)(const char *path, void *buf, u32 offset, u32 count, struct device *dev);
+	u32 (*write)(const char *path, void *buf, u32 offset, u32 count, struct device *dev);
+	u32 (*stat)(const char *path, struct stat *buf, struct device *dev);
 };
 
 struct mount_info {
@@ -40,8 +42,9 @@ struct mount_info {
 
 void vfs_install(void);
 
-u32 vfs_read(char *path, void *buf, u32 offset, u32 count);
-u32 vfs_stat(char *path);
+u32 vfs_read(const char *path, void *buf, u32 offset, u32 count);
+u32 vfs_write(const char *path, void *buf, u32 offset, u32 count);
+u32 vfs_stat(const char *path, struct stat *buf);
 
 /**
  * EXT2
@@ -134,7 +137,7 @@ struct ext2_file {
 	u32 curr_block_pos;
 };
 
-u32 ext2_read(char *path, void *buf, u32 offset, u32 count, struct device *dev);
-u32 ext2_stat(char *path);
+u32 ext2_read(const char *path, void *buf, u32 offset, u32 count, struct device *dev);
+u32 ext2_stat(const char *path, struct stat *buf, struct device *dev);
 
 #endif
-- 
cgit v1.2.3