vfs: add type macros for directory entries
This commit is contained in:
parent
e2ea205129
commit
848c374d12
2 changed files with 11 additions and 3 deletions
3
fs/vfs.c
3
fs/vfs.c
|
|
@ -73,9 +73,6 @@ struct file *vfs_open(const char *pathname, int *err)
|
||||||
*err = result;
|
*err = result;
|
||||||
slab_free(file_slab, file);
|
slab_free(file_slab, file);
|
||||||
return NULL;
|
return NULL;
|
||||||
} else if (result == VFSE_IS_BDEV) {
|
|
||||||
/* TODO: continue search into mounted filesystems */
|
|
||||||
} else {
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return file;
|
return file;
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
|
|
||||||
#define VFS_TYPE_EXT2 0x0001
|
#define VFS_TYPE_EXT2 0x0001
|
||||||
|
|
||||||
|
/* same as EXT2_INO_* */
|
||||||
#define VFS_VNO_FIFO 0x1000
|
#define VFS_VNO_FIFO 0x1000
|
||||||
#define VFS_VNO_CHARDEV 0x2000
|
#define VFS_VNO_CHARDEV 0x2000
|
||||||
#define VFS_VNO_DIR 0x4000
|
#define VFS_VNO_DIR 0x4000
|
||||||
|
|
@ -17,6 +18,15 @@
|
||||||
#define VFS_VNO_SOCK 0xC000
|
#define VFS_VNO_SOCK 0xC000
|
||||||
#define VFS_VTYPE_MASK 0xF000
|
#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_SET 0
|
||||||
#define SEEK_CUR 1
|
#define SEEK_CUR 1
|
||||||
#define SEEK_END 2
|
#define SEEK_END 2
|
||||||
|
|
@ -43,6 +53,7 @@ struct vnode {
|
||||||
uint32_t ino_num;
|
uint32_t ino_num;
|
||||||
|
|
||||||
struct fs *fs;
|
struct fs *fs;
|
||||||
|
struct vnode *ptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct dirent {
|
struct dirent {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue