diff options
author | tegge <tegge@FreeBSD.org> | 2003-03-27 19:28:11 +0000 |
---|---|---|
committer | tegge <tegge@FreeBSD.org> | 2003-03-27 19:28:11 +0000 |
commit | d1a3d87bf5410318aae8df72656b8a8a6a662c2e (patch) | |
tree | a7f557629394062db2e74fe78ad4a84a17fdf01c /sys | |
parent | 5786f3cf186048553e834bc42946c017ffed61e1 (diff) | |
download | FreeBSD-src-d1a3d87bf5410318aae8df72656b8a8a6a662c2e.zip FreeBSD-src-d1a3d87bf5410318aae8df72656b8a8a6a662c2e.tar.gz |
Eliminate a buffer sleep/wakeup race.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/ufs/ffs/ffs_rawread.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/sys/ufs/ffs/ffs_rawread.c b/sys/ufs/ffs/ffs_rawread.c index 1fc66e6..efc9713 100644 --- a/sys/ufs/ffs/ffs_rawread.c +++ b/sys/ufs/ffs/ffs_rawread.c @@ -335,9 +335,7 @@ ffs_rawread_main(struct vnode *vp, } spl = splbio(); - while ((bp->b_flags & B_DONE) == 0) { - tsleep((caddr_t)bp, PRIBIO, "rawrd", 0); - } + bwait(bp, PRIBIO, "rawrd"); splx(spl); vunmapbuf(bp); @@ -409,9 +407,7 @@ ffs_rawread_main(struct vnode *vp, relpbuf(bp, &ffsrawbufcnt); if (nbp != NULL) { /* Run down readahead buffer */ spl = splbio(); - while ((nbp->b_flags & B_DONE) == 0) { - tsleep((caddr_t)nbp, PRIBIO, "rawrd", 0); - } + bwait(nbp, PRIBIO, "rawrd"); splx(spl); vunmapbuf(nbp); relpbuf(nbp, &ffsrawbufcnt); @@ -494,5 +490,5 @@ ffs_rawread(struct vnode *vp, static void ffs_rawreadwakeup(struct buf *bp) { - wakeup((caddr_t) bp); + bdone(bp); } |