diff options
Diffstat (limited to 'ide.c')
-rw-r--r-- | ide.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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) |