From 3a5fa7ed9020eaf8ab843a16d26db7393b2ec072 Mon Sep 17 00:00:00 2001 From: Frans Kaashoek Date: Fri, 26 Aug 2011 10:08:29 -0400 Subject: Introduce and use sleeplocks instead of BUSY flags Remove I_BUSY, B_BUSY, and intrans defs and usages One spinlock per buf to avoid ugly loop in bget fix race in filewrite (don't update f->off after releasing lock) --- defs.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'defs.h') diff --git a/defs.h b/defs.h index 19d559b..8231159 100644 --- a/defs.h +++ b/defs.h @@ -5,6 +5,7 @@ struct inode; struct pipe; struct proc; struct spinlock; +struct sleeplock; struct stat; struct superblock; @@ -129,6 +130,10 @@ void initlock(struct spinlock*, char*); void release(struct spinlock*); void pushcli(void); void popcli(void); +void initsleeplock(struct sleeplock*); +void acquire_sleeplock(struct sleeplock*,struct spinlock*); +void release_sleeplock(struct sleeplock*); +int acquired_sleeplock(struct sleeplock*); // string.c int memcmp(const void*, const void*, uint); -- cgit v1.2.3