summaryrefslogtreecommitdiff
path: root/sys/isofs/udf
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2011-04-15 14:57:30 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2011-04-15 14:57:30 +0000
commitb4beef39345d1dbe85f71c6935ff2742c4b8a5b8 (patch)
tree9e953ccf05e5ba2fbe93b2d58c5fdb2fa680cafb /sys/isofs/udf
parent333e7f4bad1ad8fde2bfadcf79001104562ccc74 (diff)
In days of yore one could arbitrarily whack buffer flags. Those days
are past. Use CLR() and SET() to modify necessary flags while leaving the flags used by the buffer cache in peace. Should make bufcache code much less confused about the state of the bufs used in reading/writing disklabels. Other such flag abuses no doubt await a visit. Errors in original diff found by miod@. ok beck@ deraadt@
Diffstat (limited to 'sys/isofs/udf')
-rw-r--r--sys/isofs/udf/udf_subr.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/isofs/udf/udf_subr.c b/sys/isofs/udf/udf_subr.c
index f823d0d8b75..5dc2c014315 100644
--- a/sys/isofs/udf/udf_subr.c
+++ b/sys/isofs/udf/udf_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: udf_subr.c,v 1.20 2009/05/21 23:45:48 krw Exp $ */
+/* $OpenBSD: udf_subr.c,v 1.21 2011/04/15 14:57:29 krw Exp $ */
/*
* Copyright (c) 2006, Miodrag Vallat
@@ -110,7 +110,8 @@ udf_disklabelspoof(dev_t dev, void (*strat)(struct buf *),
*/
bp->b_blkno = sector * btodb(bsize);
bp->b_bcount = bsize;
- bp->b_flags = B_BUSY | B_READ | B_RAW;
+ CLR(bp->b_flags, B_WRITE | B_DONE);
+ SET(bp->b_flags, B_BUSY | B_READ | B_RAW);
bp->b_resid = bp->b_blkno / lp->d_secpercyl;
(*strat)(bp);
@@ -130,7 +131,8 @@ udf_disklabelspoof(dev_t dev, void (*strat)(struct buf *),
for (sector = mvds_start; sector < mvds_end; sector++) {
bp->b_blkno = sector * btodb(bsize);
bp->b_bcount = bsize;
- bp->b_flags = B_BUSY | B_READ | B_RAW;
+ CLR(bp->b_flags, B_WRITE | B_DONE);
+ SET(bp->b_flags, B_BUSY | B_READ | B_RAW);
bp->b_resid = bp->b_blkno / lp->d_secpercyl;
(*strat)(bp);