summaryrefslogtreecommitdiff
path: root/ide.c
diff options
context:
space:
mode:
authorFrans Kaashoek <[email protected]>2016-09-11 17:24:04 -0400
committerFrans Kaashoek <[email protected]>2016-09-11 17:24:04 -0400
commit6670d3b5e084d9d900d2ea13e624e72e1e28f84c (patch)
tree5ad8eb3dc3ba247c7dbe45ee082d1900853fd1e1 /ide.c
parent551c2f3576d34e4749a1165af07d90e21ad528be (diff)
downloadxv6-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.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)