diff options
author | Anton Kling <anton@kling.gg> | 2024-04-26 19:06:46 +0200 |
---|---|---|
committer | Anton Kling <anton@kling.gg> | 2024-04-26 19:06:46 +0200 |
commit | 7ab3153f92f38223157c4c1f4af1c30e33c94a76 (patch) | |
tree | 301f950cd6dc8fde244e9b5c1201ec01d964347b /kernel/fs/vfs.h | |
parent | 2e2805c88789c148cce0118d3a4ff0212458bb86 (diff) |
Kernel/VFS: Change polling from variables to functions
Instead of having to store state in variables functions are called to
check the object directly.
Diffstat (limited to 'kernel/fs/vfs.h')
-rw-r--r-- | kernel/fs/vfs.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/kernel/fs/vfs.h b/kernel/fs/vfs.h index e75d12e..83f1375 100644 --- a/kernel/fs/vfs.h +++ b/kernel/fs/vfs.h @@ -55,8 +55,8 @@ struct vfs_inode { int inode_num; int type; int ref; - u8 has_data; - u8 can_write; + int (*_has_data)(vfs_inode_t *iinode); + int (*_can_write)(vfs_inode_t *iinode); u8 is_open; void *internal_object; u64 file_size; @@ -92,9 +92,9 @@ int vfs_ftruncate(int fd, size_t length); int vfs_chdir(const char *path); int vfs_fstat(int fd, struct stat *buf); vfs_inode_t *vfs_create_inode( - int inode_num, int type, u8 has_data, u8 can_write, u8 is_open, - void *internal_object, u64 file_size, - vfs_inode_t *(*open)(const char *path), + int inode_num, int type, int (*has_data)(vfs_inode_t *inode), + int (*can_write)(vfs_inode_t *inode), u8 is_open, void *internal_object, + u64 file_size, vfs_inode_t *(*open)(const char *path), int (*create_file)(const char *path, int mode), int (*read)(u8 *buffer, u64 offset, u64 len, vfs_fd_t *fd), int (*write)(u8 *buffer, u64 offset, u64 len, vfs_fd_t *fd), |