diff --git a/include/zinnia/mutex.h b/include/zinnia/mutex.h index 1a48e90..ecece7f 100644 --- a/include/zinnia/mutex.h +++ b/include/zinnia/mutex.h @@ -1,11 +1,8 @@ #pragma once -struct task; +#include -struct mutex { - struct task* owner; - bool flag; -}; +typedef uintptr_t mutex_t; -void mutex_lock(struct mutex* mutex); -void mutex_unlock(struct mutex* mutex); +void mutex_lock(mutex_t* mutex); +void mutex_unlock(mutex_t* mutex); diff --git a/include/zinnia/vfs.h b/include/zinnia/vfs.h index 5e80ae9..8aa1b79 100644 --- a/include/zinnia/vfs.h +++ b/include/zinnia/vfs.h @@ -106,7 +106,7 @@ struct vfs_entry { // The name of this entry. char* name; size_t name_len; - struct mutex lock; + mutex_t lock; enum vfs_entry_state state; // The inode this entry points to when present. @@ -250,7 +250,7 @@ struct vfs_node { const struct vfs_file_ops* file_ops; struct vfs_super_block* sb; - struct mutex lock; + mutex_t lock; void* priv; ino_t id; @@ -305,7 +305,7 @@ struct vfs_file { enum vfs_file_position position_kind; off_t position; - struct mutex lock; + mutex_t lock; struct vfs_path path; bool has_path;