aboutsummaryrefslogtreecommitdiff
path: root/sys/isa/fd.c
diff options
context:
space:
mode:
authorJoerg Wunsch <joerg@FreeBSD.org>1995-03-12 22:40:56 +0000
committerJoerg Wunsch <joerg@FreeBSD.org>1995-03-12 22:40:56 +0000
commit82f5379bc5a0b4bea6408af89e3a72152182f673 (patch)
tree5d89eff59303264d8c3d67d07512859e35025d54 /sys/isa/fd.c
parent40ac60750ce4cf7ed36be8d71bd6dd1ec814b705 (diff)
downloadsrc-82f5379bc5a0b4bea6408af89e3a72152182f673.tar.gz
src-82f5379bc5a0b4bea6408af89e3a72152182f673.zip
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.
Notes
Notes: svn path=/head/; revision=7042
Diffstat (limited to 'sys/isa/fd.c')
-rw-r--r--sys/isa/fd.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/sys/isa/fd.c b/sys/isa/fd.c
index 8e553c66dad5..94b032919508 100644
--- a/sys/isa/fd.c
+++ b/sys/isa/fd.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;
}