vfs: inode: add inode modes and filetypes

Signed-off-by: Michael Shaw <m@michaelsshaw.com>
This commit is contained in:
Michael Shaw 2026-07-04 22:20:38 +02:00
commit 2534c317f2
2 changed files with 30 additions and 8 deletions

View file

@ -34,14 +34,14 @@ typedef struct _dirent dirent_t;
typedef struct _fs fs_t;
struct inode_ops {
/* for all files */
/* FOR ALL FILES */
ssize_t (*read)(inode_t *inode, char *buf, size_t size, size_t offset);
ssize_t (*write)(inode_t *inode, char *buf, size_t size, size_t offset);
/* for directory files */
int (*creat)(inode_t *inode, const char *name, u64 mode, dirent_t **out);
int (*mkdir)(inode_t *inode, const char *name, dirent_t **out);
int (*link)(inode_t *inode, inode_t *link_inode, const char *name, dirent_t **out);
int (*unlink)(inode_t *inode, const char *name);
/* FOR DIRECTORY FILES */
int (*link)(dirent_t *in, inode_t *to, const char *name, dirent_t **out);
int (*unlink)(dirent_t *dent);
ssize_t (*get_dents)(inode_t *parent, dirent_t **dents);
};
@ -49,7 +49,7 @@ struct _inode {
u64 mode;
u64 ino_num;
u64 file_size;
dirent_t *dentry;
dirent_t *dentry;
u64 flags;