summaryrefslogtreecommitdiffstats
path: root/sys/dev/fdc
diff options
context:
space:
mode:
authorjoerg <joerg@FreeBSD.org>1995-03-12 22:40:56 +0000
committerjoerg <joerg@FreeBSD.org>1995-03-12 22:40:56 +0000
commitd96851c18728c6610d33785fd2ffc275f253497f (patch)
tree5d89eff59303264d8c3d67d07512859e35025d54 /sys/dev/fdc
parenta38ffc0b136b03eeaddcdf16cecaf8f2e10af606 (diff)
downloadFreeBSD-src-d96851c18728c6610d33785fd2ffc275f253497f.zip
FreeBSD-src-d96851c18728c6610d33785fd2ffc275f253497f.tar.gz
Finally get rid of this bothering ``biodone: buffer already done''
warning. The buffer needs only to be `biodone()' again if the format operation timed out; otherwise fdstate() did already do the job.
Diffstat (limited to 'sys/dev/fdc')
-rw-r--r--sys/dev/fdc/fdc.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/sys/dev/fdc/fdc.c b/sys/dev/fdc/fdc.c
index 8e553c6..94b0329 100644
--- a/sys/dev/fdc/fdc.c
+++ b/sys/dev/fdc/fdc.c
@@ -43,7 +43,7 @@
* SUCH DAMAGE.
*
* from: @(#)fd.c 7.4 (Berkeley) 5/25/91
- * $Id: fd.c,v 1.51 1995/01/27 20:03:07 jkh Exp $
+ * $Id: fd.c,v 1.52 1995/02/26 01:37:51 bde Exp $
*
*/
@@ -1682,6 +1682,10 @@ fdformat(dev, finfo, p)
bp = (struct buf *)malloc(sizeof(struct buf), M_TEMP, M_NOWAIT);
if(bp == 0)
return ENOBUFS;
+ /*
+ * keep the process from being swapped
+ */
+ p->p_flag |= P_PHYSIO;
bzero((void *)bp, sizeof(struct buf));
bp->b_flags = B_BUSY | B_PHYS | B_FORMAT;
bp->b_proc = p;
@@ -1710,12 +1714,17 @@ fdformat(dev, finfo, p)
}
splx(s);
- if(rv == EWOULDBLOCK)
+ if(rv == EWOULDBLOCK) {
/* timed out */
rv = EIO;
+ biodone(bp);
+ }
if(bp->b_flags & B_ERROR)
rv = bp->b_error;
- biodone(bp);
+ /*
+ * allow the process to be swapped
+ */
+ p->p_flag &= ~P_PHYSIO;
free(bp, M_TEMP);
return rv;
}
OpenPOWER on IntegriCloud