diff options
author | joerg <joerg@FreeBSD.org> | 1995-03-12 22:40:56 +0000 |
---|---|---|
committer | joerg <joerg@FreeBSD.org> | 1995-03-12 22:40:56 +0000 |
commit | d96851c18728c6610d33785fd2ffc275f253497f (patch) | |
tree | 5d89eff59303264d8c3d67d07512859e35025d54 /sys/i386 | |
parent | a38ffc0b136b03eeaddcdf16cecaf8f2e10af606 (diff) | |
download | FreeBSD-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/i386')
-rw-r--r-- | sys/i386/isa/fd.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/sys/i386/isa/fd.c b/sys/i386/isa/fd.c index 8e553c6..94b0329 100644 --- a/sys/i386/isa/fd.c +++ b/sys/i386/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; } |