From 52920b03e996cf60b2665772837bfa0f1661a430 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Thu, 7 Jan 2021 22:06:24 +0100 Subject: New read parameters --- kernel/inc/fs.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'kernel/inc/fs.h') diff --git a/kernel/inc/fs.h b/kernel/inc/fs.h index 8af28c4..7831603 100644 --- a/kernel/inc/fs.h +++ b/kernel/inc/fs.h @@ -14,8 +14,8 @@ struct device { const char *name; int type; // TODO: Block, char device struct vfs *vfs; - u8 (*read)(u8 *buf, u32 offset, u32 count, struct device *dev); - u8 (*write)(u8 *buf, u32 offset, u32 count, struct device *dev); + u32 (*read)(void *buf, u32 offset, u32 count, struct device *dev); + u32 (*write)(void *buf, u32 offset, u32 count, struct device *dev); }; void device_install(void); @@ -29,8 +29,8 @@ enum vfs_type { VFS_DEVFS, VFS_TMPFS, VFS_PROCFS, VFS_EXT2 }; struct vfs { enum vfs_type type; int flags; - //u8 (*read)(char *, char *, struct device *, void *); - //u8 (*mount)(struct device *, void *); + 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); }; struct mount_info { @@ -40,7 +40,7 @@ struct mount_info { void vfs_install(void); -void *vfs_read(char *path); +u32 vfs_read(char *path, void *buf, u32 offset, u32 count); u32 vfs_stat(char *path); /** @@ -134,7 +134,7 @@ struct ext2_file { u32 curr_block_pos; }; -void *ext2_read(char *path); +u32 ext2_read(char *path, void *buf, u32 offset, u32 count, struct device *dev); u32 ext2_stat(char *path); #endif -- cgit v1.2.3