diff options
author | Frans Kaashoek <[email protected]> | 2016-09-11 17:24:04 -0400 |
---|---|---|
committer | Frans Kaashoek <[email protected]> | 2016-09-11 17:24:04 -0400 |
commit | 6670d3b5e084d9d900d2ea13e624e72e1e28f84c (patch) | |
tree | 5ad8eb3dc3ba247c7dbe45ee082d1900853fd1e1 /ide.c | |
parent | 551c2f3576d34e4749a1165af07d90e21ad528be (diff) | |
download | xv6-labs-6670d3b5e084d9d900d2ea13e624e72e1e28f84c.tar.gz xv6-labs-6670d3b5e084d9d900d2ea13e624e72e1e28f84c.tar.bz2 xv6-labs-6670d3b5e084d9d900d2ea13e624e72e1e28f84c.zip |
Straight replacement of B_BUSY with a sleeping lock.
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) |