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