From 6670d3b5e084d9d900d2ea13e624e72e1e28f84c Mon Sep 17 00:00:00 2001 From: Frans Kaashoek Date: Sun, 11 Sep 2016 17:24:04 -0400 Subject: Straight replacement of B_BUSY with a sleeping lock. --- ide.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'ide.c') diff --git a/ide.c b/ide.c index 7fad55d..b3112b9 100644 --- a/ide.c +++ b/ide.c @@ -9,6 +9,7 @@ #include "x86.h" #include "traps.h" #include "spinlock.h" +#include "sleeplock.h" #include "fs.h" #include "buf.h" @@ -139,8 +140,8 @@ iderw(struct buf *b) { struct buf **pp; - if(!(b->flags & B_BUSY)) - panic("iderw: buf not busy"); + if(!holdingsleep(&b->lock)) + panic("iderw: buf not locked"); if((b->flags & (B_VALID|B_DIRTY)) == B_VALID) panic("iderw: nothing to do"); if(b->dev != 0 && !havedisk1) -- cgit v1.2.3