vfs: add open and close functions
This commit is contained in:
parent
9476b3f810
commit
f2dd8ae8a7
4 changed files with 78 additions and 102 deletions
|
|
@ -6,5 +6,6 @@
|
|||
#define ENOMEM 1
|
||||
#define ENOENT 2
|
||||
#define EINVAL 3
|
||||
#define EBADF 4
|
||||
|
||||
#endif /* _ERRNO_H_ */
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@
|
|||
|
||||
#include <kernel/common.h>
|
||||
|
||||
#define VFSE_IS_BDEV 0xFFFA
|
||||
|
||||
#define VFS_TYPE_EXT2 0x0001
|
||||
|
||||
struct inode {
|
||||
|
|
@ -38,9 +40,20 @@ struct file {
|
|||
|
||||
uint32_t inode_num; /* inode number */
|
||||
uint64_t size; /* size of the file */
|
||||
uint64_t pos; /* current position in the file */
|
||||
|
||||
void *fs_file;
|
||||
char *path; /* path to the file */
|
||||
|
||||
void *fs_file; /* filesystem specific object */
|
||||
};
|
||||
|
||||
struct file_descriptor {
|
||||
struct file file;
|
||||
|
||||
uint64_t pos;
|
||||
int fd;
|
||||
uint32_t flags;
|
||||
|
||||
struct fs *fs;
|
||||
};
|
||||
|
||||
struct fs_ops {
|
||||
|
|
|
|||
Loading…
Reference in a new issue