devfs: add vnodes to devfs tree

This commit is contained in:
Michael Shaw 2024-02-12 21:11:56 -05:00
commit c487c4c9dd
8 changed files with 152 additions and 26 deletions

View file

@ -2,4 +2,6 @@
#ifndef _DEVFS_H_
#define _DEVFS_H_
struct fs *devfs_init();
#endif /* _DEVFS_H_ */

View file

@ -73,6 +73,8 @@ struct vnode {
bool mount_ptr; /* does this node point to a root of a mounted fs? */
bool no_free; /* permanently cached vnodes */
void *priv_data;
size_t refcount;
spinlock_t lock;
};
@ -111,8 +113,6 @@ struct file_descriptor {
char *buf;
size_t buf_len;
int (*buf_write)(struct file_descriptor *fdesc, void *buf, size_t count);
int (*buf_read)(struct file_descriptor *fdesc, void *buf, size_t count);
struct fs *fs;
};
@ -158,6 +158,7 @@ char *dirname(char *path);
struct fs *vfs_create();
struct vnode *vfs_create_vno();
void vfs_dealloc(struct fs *fs);
int vfs_mount(struct fs *fs, const char *mount_point);
int stdout_write(struct file_descriptor *fdesc, void *buf, size_t len);