summaryrefslogtreecommitdiff
path: root/ide.c
diff options
context:
space:
mode:
Diffstat (limited to 'ide.c')
-rw-r--r--ide.c5
1 files changed, 3 insertions, 2 deletions
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)