sched: apply proper blocking mechanism for chardev

Signed-off-by: Michael Shaw <spencershawiscool@gmail.com>
This commit is contained in:
Michael Shaw 2024-06-17 14:09:53 -04:00
commit dfed938383
12 changed files with 183 additions and 24 deletions

View file

@ -4,6 +4,7 @@
#include <kernel/rbtree.h>
#include <fs/ext2.h>
#include <fs/devfs.h>
#include <fs/vfs.h>
#include <lib/stack.h>
@ -243,6 +244,16 @@ char *dirname(char *path)
return path;
}
inline uint64_t vfs_file_type(struct file *file)
{
return file->vnode->flags & VFS_VTYPE_MASK;
}
inline void *vfs_file_dev(struct file *file)
{
return ((struct devfs_dev_info *)file->vnode->priv_data)->dev;
}
struct vnode *vfs_create_vno()
{
struct vnode *vnode = slab_alloc(vnode_slab);