vfs: restructure vfs to reduce various errors
Signed-off-by: Michael Shaw <m@michaelsshaw.com>
This commit is contained in:
parent
1fc17e6d6e
commit
0c29f0e517
7 changed files with 220 additions and 253 deletions
|
|
@ -2,12 +2,13 @@
|
|||
#ifndef _RWLOCK_H_
|
||||
#define _RWLOCK_H_
|
||||
|
||||
#include <lib/sem.h>
|
||||
#include <kernel/spinlock.h>
|
||||
#include <kernel/types.h>
|
||||
|
||||
typedef struct _rwlock {
|
||||
sem_t sem;
|
||||
spinlock_t reader_lock;
|
||||
u64 reader_count;
|
||||
typedef struct {
|
||||
spinlock_t lock;
|
||||
u64 readers;
|
||||
bool writer;
|
||||
} rwlock_t;
|
||||
|
||||
void read_lock(rwlock_t *lock);
|
||||
|
|
|
|||
Loading…
Reference in a new issue