xref: /original-bsd/sys/ufs/lfs/lfs_bio.c (revision 217010d6)
1 /*
2  * Copyright (c) 1982, 1986, 1989 Regents of the University of California.
3  * All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  *
7  *	@(#)lfs_bio.c	5.1 (Berkeley) 09/25/91
8  */
9 
10 #include "param.h"
11 #include "proc.h"
12 #include "buf.h"
13 #include "vnode.h"
14 #include "specdev.h"
15 #include "mount.h"
16 #include "trace.h"
17 #include "resourcevar.h"
18 #include "lfs.h"
19 
20 /*
21  * lfs_bwrite --
22  *	LFS version of bawrite, bdwrite, bwrite.  Set the delayed write flag
23  *	and use reassignbuf to move the buffer from the clean list to the
24  *	dirty one.  Then unlock the buffer.
25  */
26 lfs_bwrite(bp)
27 	register BUF *bp;
28 {
29 	curproc->p_stats->p_ru.ru_oublock++;	/* XXX: no one paid yet */
30 	bp->b_flags &= ~(B_READ | B_DONE | B_ERROR | B_DELWRI);
31 	bp->b_flags |= B_DELWRI;
32 	reassignbuf(bp, bp->b_vp);		/* XXX: do this inline */
33 	brelse(bp);
34 }
35