mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-14 10:09:48 +00:00
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.
This commit is contained in:
parent
40ac60750c
commit
82f5379bc5
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=7042
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
15
sys/isa/fd.c
15
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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user