From 848c374d12723b96359db3e09c0a24f1a90f924c Mon Sep 17 00:00:00 2001 From: Michael Shaw Date: Wed, 24 Jan 2024 20:09:27 -0500 Subject: [PATCH] vfs: add type macros for directory entries --- fs/vfs.c | 3 --- include/fs/vfs.h | 11 +++++++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/fs/vfs.c b/fs/vfs.c index f0be809..b9320c5 100644 --- a/fs/vfs.c +++ b/fs/vfs.c @@ -73,9 +73,6 @@ struct file *vfs_open(const char *pathname, int *err) *err = result; slab_free(file_slab, file); return NULL; - } else if (result == VFSE_IS_BDEV) { - /* TODO: continue search into mounted filesystems */ - } else { } return file; diff --git a/include/fs/vfs.h b/include/fs/vfs.h index 5bd31a6..80dbf71 100644 --- a/include/fs/vfs.h +++ b/include/fs/vfs.h @@ -8,6 +8,7 @@ #define VFS_TYPE_EXT2 0x0001 +/* same as EXT2_INO_* */ #define VFS_VNO_FIFO 0x1000 #define VFS_VNO_CHARDEV 0x2000 #define VFS_VNO_DIR 0x4000 @@ -17,6 +18,15 @@ #define VFS_VNO_SOCK 0xC000 #define VFS_VTYPE_MASK 0xF000 +#define VFS_DE_UNKNOWN 0 +#define VFS_DE_FILE 1 +#define VFS_DE_DIR 2 +#define VFS_DE_CHRDEV 3 +#define VFS_DE_BLKDEV 4 +#define VFS_DE_FIFO 5 +#define VFS_DE_SOCK 6 +#define VFS_DE_SYMLINK 7 + #define SEEK_SET 0 #define SEEK_CUR 1 #define SEEK_END 2 @@ -43,6 +53,7 @@ struct vnode { uint32_t ino_num; struct fs *fs; + struct vnode *ptr; }; struct dirent {